Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()

if (mMaster == nullptr) {
cudaDeviceProp deviceProp;
int deviceMemoryClockRate{0}, deviceClockRate{0};
int32_t count, bestDevice = -1;
double bestDeviceSpeed = -1, deviceSpeed;
if (GPUChkErrI(cudaGetDeviceCount(&count))) {
Expand Down Expand Up @@ -153,7 +154,9 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
if (GetProcessingSettings().debugLevel >= 4) {
GPUInfo("Obtained current memory usage for device %d", i);
}
if (GPUChkErrI(cudaGetDeviceProperties(&deviceProp, i))) {
if (GPUChkErrI(cudaGetDeviceProperties(&deviceProp, i)) ||
GPUChkErrI(cudaDeviceGetAttribute(&deviceMemoryClockRate, cudaDevAttrMemoryClockRate, i)) ||
GPUChkErrI(cudaDeviceGetAttribute(&deviceClockRate, cudaDevAttrClockRate, i))) {
continue;
}
if (GetProcessingSettings().debugLevel >= 4) {
Expand All @@ -172,7 +175,7 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
deviceFailure = "Insufficient GPU memory";
}

deviceSpeed = (double)deviceProp.multiProcessorCount * (double)deviceProp.clockRate * (double)deviceProp.warpSize * (double)free * (double)deviceProp.major * (double)deviceProp.major;
deviceSpeed = (double)deviceProp.multiProcessorCount * (double)deviceClockRate * (double)deviceProp.warpSize * (double)free * (double)deviceProp.major * (double)deviceProp.major;
if (GetProcessingSettings().debugLevel >= 2) {
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);
}
Expand Down Expand Up @@ -239,8 +242,8 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
GPUInfo("\ttotalConstMem = %ld", (uint64_t)deviceProp.totalConstMem);
GPUInfo("\tmajor = %d", deviceProp.major);
GPUInfo("\tminor = %d", deviceProp.minor);
GPUInfo("\tclockRate = %d", deviceProp.clockRate);
GPUInfo("\tmemoryClockRate = %d", deviceProp.memoryClockRate);
GPUInfo("\tclockRate = %d", deviceClockRate);
GPUInfo("\tdeviceMemoryClockRateRate = %d", deviceMemoryClockRate);
GPUInfo("\tmultiProcessorCount = %d", deviceProp.multiProcessorCount);
GPUInfo("\ttextureAlignment = %ld", (uint64_t)deviceProp.textureAlignment);
GPUInfo(" ");
Expand Down Expand Up @@ -371,7 +374,7 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime()
#endif
mDeviceConstantMem = (GPUConstantMem*)devPtrConstantMem;

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);
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);
} else {
GPUReconstructionCUDA* master = dynamic_cast<GPUReconstructionCUDA*>(mMaster);
mDeviceId = master->mDeviceId;
Expand Down
10 changes: 7 additions & 3 deletions dependencies/FindO2GPU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# or submit itself to any jurisdiction.

# NOTE!!!! - Whenever this file is changed, move it over to alidist/resources
# FindO2GPU.cmake Version 4
# FindO2GPU.cmake Version 5

if(NOT DEFINED ENABLE_CUDA)
set(ENABLE_CUDA "AUTO")
Expand Down Expand Up @@ -139,10 +139,14 @@ if(ENABLE_CUDA)
message(${FAILURE_SEVERITY} "CUDA was found but cannot be enabled")
set(CMAKE_CUDA_COMPILER OFF)
endif()
find_path(THRUST_INCLUDE_DIR thrust/version.h PATHS ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} NO_DEFAULT_PATH)
find_path(THRUST_INCLUDE_DIR thrust/version.h PATHS ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
PATH_SUFFIXES "" cccl
NO_DEFAULT_PATH)
if(THRUST_INCLUDE_DIR STREQUAL "THRUST_INCLUDE_DIR-NOTFOUND")
message(${FAILURE_SEVERITY} "CUDA found but thrust not available")
message(${FAILURE_SEVERITY} "CUDA found but thrust not available, looked under: ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}")
set(CMAKE_CUDA_COMPILER OFF)
else()
message(STATUS "Thrust found in the path: ${THRUST_INCLUDE_DIR}")
endif()
if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "12.8")
message(${FAILURE_SEVERITY} "CUDA Version too old: ${CMAKE_CUDA_COMPILER_VERSION}, 12.8 required")
Expand Down