@@ -120,6 +120,7 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
120120
121121 if (mMaster == nullptr ) {
122122 cudaDeviceProp deviceProp;
123+ int deviceMemoryClockRate{0 }, deviceClockRate{0 };
123124 int32_t count, bestDevice = -1 ;
124125 double bestDeviceSpeed = -1 , deviceSpeed;
125126 if (GPUChkErrI (cudaGetDeviceCount (&count))) {
@@ -153,7 +154,9 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
153154 if (GetProcessingSettings ().debugLevel >= 4 ) {
154155 GPUInfo (" Obtained current memory usage for device %d" , i);
155156 }
156- if (GPUChkErrI (cudaGetDeviceProperties (&deviceProp, i))) {
157+ if (GPUChkErrI (cudaGetDeviceProperties (&deviceProp, i)) ||
158+ GPUChkErrI (cudaDeviceGetAttribute (&deviceMemoryClockRate, cudaDevAttrMemoryClockRate, i)) ||
159+ GPUChkErrI (cudaDeviceGetAttribute (&deviceClockRate, cudaDevAttrClockRate, i))) {
157160 continue ;
158161 }
159162 if (GetProcessingSettings ().debugLevel >= 4 ) {
@@ -172,7 +175,7 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
172175 deviceFailure = " Insufficient GPU memory" ;
173176 }
174177
175- deviceSpeed = (double )deviceProp.multiProcessorCount * (double )deviceProp. clockRate * (double )deviceProp.warpSize * (double )free * (double )deviceProp.major * (double )deviceProp.major ;
178+ deviceSpeed = (double )deviceProp.multiProcessorCount * (double )deviceClockRate * (double )deviceProp.warpSize * (double )free * (double )deviceProp.major * (double )deviceProp.major ;
176179 if (GetProcessingSettings ().debugLevel >= 2 ) {
177180 GPUImportant (" Device %s%2d: %s (Rev: %d.%d - Mem Avail %lu / %lu)%s %s" , deviceOK ? " " : " [" , i, deviceProp.name , deviceProp.major , deviceProp.minor , free , (size_t )deviceProp.totalGlobalMem , deviceOK ? " " : " ]" , deviceOK ? " " : deviceFailure);
178181 }
@@ -239,8 +242,8 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
239242 GPUInfo (" \t totalConstMem = %ld" , (uint64_t )deviceProp.totalConstMem );
240243 GPUInfo (" \t major = %d" , deviceProp.major );
241244 GPUInfo (" \t minor = %d" , deviceProp.minor );
242- GPUInfo (" \t clockRate = %d" , deviceProp. clockRate );
243- GPUInfo (" \t memoryClockRate = %d" , deviceProp. memoryClockRate );
245+ GPUInfo (" \t clockRate = %d" , deviceClockRate );
246+ GPUInfo (" \t deviceMemoryClockRateRate = %d" , deviceMemoryClockRate );
244247 GPUInfo (" \t multiProcessorCount = %d" , deviceProp.multiProcessorCount );
245248 GPUInfo (" \t textureAlignment = %ld" , (uint64_t )deviceProp.textureAlignment );
246249 GPUInfo (" " );
@@ -371,7 +374,7 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
371374#endif
372375 mDeviceConstantMem = (GPUConstantMem*)devPtrConstantMem;
373376
374- GPUInfo (" CUDA Initialisation successfull (Device %d: %s (Frequency %d, Cores %d), %ld / %ld bytes host / global memory, Stack frame %d, Constant memory %ld)" , mDeviceId , deviceProp.name , deviceProp. clockRate , deviceProp.multiProcessorCount , (int64_t )mHostMemorySize , (int64_t )mDeviceMemorySize , (int32_t )GPUCA_GPU_STACK_SIZE, (int64_t )gGPUConstantMemBufferSize );
377+ GPUInfo (" CUDA Initialisation successfull (Device %d: %s (Frequency %d, Cores %d), %ld / %ld bytes host / global memory, Stack frame %d, Constant memory %ld)" , mDeviceId , deviceProp.name , deviceClockRate , deviceProp.multiProcessorCount , (int64_t )mHostMemorySize , (int64_t )mDeviceMemorySize , (int32_t )GPUCA_GPU_STACK_SIZE, (int64_t )gGPUConstantMemBufferSize );
375378 } else {
376379 GPUReconstructionCUDA* master = dynamic_cast <GPUReconstructionCUDA*>(mMaster );
377380 mDeviceId = master->mDeviceId ;
0 commit comments