Skip to content

Commit cd85741

Browse files
committed
Add error message for NVCC{9/9.1} + GCC6 combo
1 parent e251fb5 commit cd85741

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

cmake/public/cuda.cmake

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,21 @@ else()
298298
list(APPEND CUDA_NVCC_FLAGS "-DONNX_NAMESPACE=onnx_c2")
299299
endif()
300300

301-
# CUDA 9.x requires GCC version <= 6
301+
# CUDA 9.0 & 9.1 requires GCC version <= 5
302+
# Although they support GCC 6, but a bug that wasn't fixed until 9.2 prevents
303+
# them from compiling the std::tuple header of GCC 6.
304+
# See Sec. 2.2.1 of
305+
# https://developer.download.nvidia.com/compute/cuda/9.2/Prod/docs/sidebar/CUDA_Toolkit_Release_Notes.pdf
302306
if ((CUDA_VERSION VERSION_EQUAL 9.0) OR
303307
(CUDA_VERSION VERSION_GREATER 9.0 AND CUDA_VERSION VERSION_LESS 9.2))
304308
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
305-
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0 AND
309+
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0 AND
306310
CUDA_HOST_COMPILER STREQUAL CMAKE_C_COMPILER)
307311
message(FATAL_ERROR
308-
"CUDA ${CUDA_VERSION} is not compatible with GCC version >= 7. "
309-
"Use the following option to use another version (for example): \n"
310-
" -DCUDA_HOST_COMPILER=/usr/bin/gcc-6\n")
312+
"CUDA ${CUDA_VERSION} is not compatible with std::tuple from GCC version "
313+
">= 6. Please upgrade to CUDA 9.2 or use the following option to use "
314+
"another version (for example): \n"
315+
" -DCUDA_HOST_COMPILER=/usr/bin/gcc-5\n")
311316
endif()
312317
elseif (CUDA_VERSION VERSION_EQUAL 8.0)
313318
# CUDA 8.0 requires GCC version <= 5

0 commit comments

Comments
 (0)