From 43819f67fa645bef3a801b026554413f669d45e1 Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Fri, 7 Nov 2025 16:07:19 +0100 Subject: [PATCH 1/3] Find Thrust in CUDA13 --- dependencies/FindO2GPU.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dependencies/FindO2GPU.cmake b/dependencies/FindO2GPU.cmake index 9f335eaa6600a..6661d698f15f7 100644 --- a/dependencies/FindO2GPU.cmake +++ b/dependencies/FindO2GPU.cmake @@ -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") From 1161b1d09fc615df463401c3863434c5833c307e Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Fri, 7 Nov 2025 17:22:08 +0100 Subject: [PATCH 2/3] Fix compatibility with CUDA13 --- GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu index 62b490a59d0dc..8e896ca513f53 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu @@ -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))) { @@ -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) { @@ -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); } @@ -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(" "); @@ -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(mMaster); mDeviceId = master->mDeviceId; From 95e3beacc28ec1113f8956bf703d1ff57fa9c2e4 Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Tue, 11 Nov 2025 14:53:00 +0100 Subject: [PATCH 3/3] Update FindO2GPU.cmake version to 5 --- dependencies/FindO2GPU.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/FindO2GPU.cmake b/dependencies/FindO2GPU.cmake index 6661d698f15f7..4813ac18eae72 100644 --- a/dependencies/FindO2GPU.cmake +++ b/dependencies/FindO2GPU.cmake @@ -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")