Skip to content

Commit e4801de

Browse files
committed
Minor corrections to NVML example.
1 parent 3446e51 commit e4801de

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

posts/nvml/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ALL: run
22

33
nvml_test: Makefile nvml_test.cu matrixMul.cu
4-
nvcc -I$(GPU_DEPLOYMENT_KIT_ROOT_DIR)/include/nvidia/gdk -lnvidia-ml nvml_test.cu matrixMul.cu -o nvml_test
4+
nvcc -gencode arch=compute_35,code=sm_35 -I$(GPU_DEPLOYMENT_KIT_ROOT_DIR)/include/nvidia/gdk -lnvidia-ml nvml_test.cu matrixMul.cu -o nvml_test
55

66
run: nvml_test
77
./nvml_test

posts/nvml/matrixMul.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int matrixMultiply(dim3 &dimsA, dim3 &dimsB)
138138
float *h_B = (float *)malloc(mem_size_B);
139139

140140
// Initialize host memory
141-
const float valB = 0.01f;
141+
const float valB = 0.001f;
142142
constantInit(h_A, size_A, 1.0f);
143143
constantInit(h_B, size_B, valB);
144144

posts/nvml/nvml_test.cu

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ int main()
100100

101101
if ( NVML_FEATURE_DISABLED == isRestricted )
102102
{
103-
dim3 dimsA(256,256);
104-
dim3 dimsB(256,256);
103+
dim3 dimsA(1024,1024);
104+
dim3 dimsB(1024,1024);
105105

106106
for ( int i=numSupportedSMClocks-1; i >= 0; --i )
107107
{
@@ -113,6 +113,10 @@ int main()
113113
matrixMultiply(dimsA, dimsB);
114114
}
115115
}
116+
else
117+
{
118+
std::cerr<<"ERROR: Application clock permissions are set to RESTRICTED. Please change with sudo nvidia-smi -acp UNRESTRICTED"<<std::endl;
119+
}
116120

117121
//Reset Application Clocks and Shutdown NVML
118122
if ( NVML_FEATURE_DISABLED == isRestricted )

0 commit comments

Comments
 (0)