Skip to content

Commit ab7b8ce

Browse files
authored
build: check for the bad combo of Cuda >= 13.2 but LLVM < 22.1.2 (AcademySoftwareFoundation#2133)
Fixes AcademySoftwareFoundation#2129 CUDA 13.2+ requires LLVM 22.1.2+ for the _NV_RSQRT_SPECIFIER fix. Assisted-by: Claude Code / sonnet-4.6 Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent e5552e0 commit ab7b8ce

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/cmake/externalpackages.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,16 @@ if (OSL_USE_OPTIX)
132132
message (FATAL_ERROR "NVPTX target is not available in the provided LLVM build")
133133
endif()
134134

135+
# CUDA 13.2+ requires LLVM 22.1.2+ for the _NV_RSQRT_SPECIFIER fix.
136+
# See: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues/2129
137+
if (CUDA_VERSION VERSION_GREATER_EQUAL "13.2" AND LLVM_VERSION VERSION_LESS "22.1.2")
138+
message (FATAL_ERROR
139+
"${ColorRed}CUDA ${CUDA_VERSION} requires LLVM 22.1.2 or newer "
140+
"(you have LLVM ${LLVM_VERSION}). CUDA 13.2+ needs the "
141+
"_NV_RSQRT_SPECIFIER fix from llvm-project commit c1c833734cf0, "
142+
"first shipped in LLVM 22.1.2. Either upgrade LLVM or downgrade CUDA.${ColorReset}")
143+
endif ()
144+
135145
set (CUDA_LIB_FLAGS "--cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
136146

137147
# If the user wants, try to use static libs here to putting static lib

0 commit comments

Comments
 (0)