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
1 change: 1 addition & 0 deletions GPU/GPUTracking/Base/GPUReconstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ class GPUReconstruction

// Private helpers for library loading
static std::shared_ptr<LibraryLoader>* GetLibraryInstance(DeviceType type, bool verbose);
static std::string getBackendVersions();

// Private helper functions for memory management
size_t AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*SetPointers)(void*), void*& memorypoolend, const char* device);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
/// \file GPUReconstructionAvailableBackends.h
/// \author David Rohr

// clang-format off
#cmakedefine CUDA_ENABLED
#cmakedefine HIP_ENABLED
#cmakedefine OPENCL_ENABLED
#cmakedefine GPUCA_COMPILER_VERSIONS @GPUCA_COMPILER_VERSIONS@
// clang-format on
5 changes: 5 additions & 0 deletions GPU/GPUTracking/Base/GPUReconstructionLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,8 @@ int32_t GPUReconstruction::LibraryLoader::CloseLibrary()
mGPUEntry = nullptr;
return 0;
}

std::string GPUReconstruction::getBackendVersions()
{
return GPUCA_M_STR(GPUCA_COMPILER_VERSIONS);
}
11 changes: 8 additions & 3 deletions GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,16 @@ int32_t GPUReconstructionCUDA::genRTC(std::string& filename, uint32_t& nCompile)
GPUInfo("RTC Launch Bounds:\n%s", launchBounds.c_str());
}

char shasource[21], shaparam[21], shacmd[21], shakernels[21], shabounds[21];
const std::string compilerVersions = getBackendVersions();

char shasource[21], shaparam[21], shacmd[21], shakernels[21], shabounds[21], shaversion[21];
if (GetProcessingSettings().rtc.cacheOutput) {
o2::framework::internal::SHA1(shasource, _binary_GPUReconstructionCUDArtc_src_start, _binary_GPUReconstructionCUDArtc_src_len);
o2::framework::internal::SHA1(shaparam, rtcparam.c_str(), rtcparam.size());
o2::framework::internal::SHA1(shacmd, baseCommand.c_str(), baseCommand.size());
o2::framework::internal::SHA1(shakernels, kernelsall.c_str(), kernelsall.size());
o2::framework::internal::SHA1(shabounds, launchBounds.c_str(), launchBounds.size());
o2::framework::internal::SHA1(shaversion, compilerVersions.c_str(), compilerVersions.size());
}

nCompile = GetProcessingSettings().rtc.compilePerKernel ? kernels.size() : 1;
Expand Down Expand Up @@ -131,11 +134,12 @@ int32_t GPUReconstructionCUDA::genRTC(std::string& filename, uint32_t& nCompile)
}
return 0;
};
if (checkSHA(shasource, "source") || // TODO: CHECK VERSION!
if (checkSHA(shasource, "source") ||
checkSHA(shaparam, "param") ||
checkSHA(shacmd, "command line") ||
checkSHA(shakernels, "kernel definitions") ||
checkSHA(shabounds, "launch bounds")) {
checkSHA(shabounds, "launch bounds") ||
checkSHA(shaversion, "compiler versions")) {
break;
}
GPUSettingsProcessingRTC cachedSettings;
Expand Down Expand Up @@ -237,6 +241,7 @@ int32_t GPUReconstructionCUDA::genRTC(std::string& filename, uint32_t& nCompile)
fwrite(shacmd, 1, 20, fp) != 20 ||
fwrite(shakernels, 1, 20, fp) != 20 ||
fwrite(shabounds, 1, 20, fp) != 20 ||
fwrite(shaversion, 1, 20, fp) != 20 ||
fwrite(&GetProcessingSettings().rtc, sizeof(GetProcessingSettings().rtc), 1, fp) != 1) {
throw std::runtime_error("Error writing cache file");
}
Expand Down
1 change: 1 addition & 0 deletions GPU/GPUTracking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ install(DIRECTORY utils
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GPU
FILES_MATCHING PATTERN *.h)

set(GPUCA_COMPILER_VERSIONS "CUDA ${CMAKE_CUDA_COMPILER_VERSION} HIP ${hip_VERSION} ${CMAKE_HIP_COMPILER_VERSION} ROCM ${CMAKE_HIP_COMPILER_ROCM_ROOT} LLVM ${LLVM_PACKAGE_VERSION}")

# GPUReconstructionLibrary needs to know which GPU backends are enabled for proper error messages
configure_file(Base/GPUReconstructionAvailableBackends.template.h ${CMAKE_CURRENT_BINARY_DIR}/GPUReconstructionAvailableBackends.h)
Expand Down
6 changes: 3 additions & 3 deletions dependencies/FindO2GPU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ if(ENABLE_CUDA)
message(${FAILURE_SEVERITY} "CUDA found but thrust not available")
set(CMAKE_CUDA_COMPILER OFF)
endif()
if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "12.6")
message(${FAILURE_SEVERITY} "CUDA Version too old: ${CMAKE_CUDA_COMPILER_VERSION}, 12.6 required")
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")
set(CMAKE_CUDA_COMPILER OFF)
endif()
endif()
Expand Down Expand Up @@ -279,7 +279,7 @@ if(ENABLE_HIP)
elseif(NOT ENABLE_HIP STREQUAL "AUTO")
message(FATAL_ERROR "HIP requested, but CMAKE_PREFIX_PATH env variable does not contain rocm folder!")
endif()
if(hip_FOUND AND NOT hip_VERSION VERSION_GREATER_EQUAL "5.5")
if(hip_FOUND AND NOT hip_VERSION VERSION_GREATER_EQUAL "6.3")
set(hip_FOUND 0)
endif()
if(hip_FOUND AND hipcub_FOUND AND rocthrust_FOUND AND rocprim_FOUND AND hip_HIPCC_EXECUTABLE AND hip_HIPIFY_PERL_EXECUTABLE)
Expand Down