diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 962b42c190..db929cba4f 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1542,6 +1542,8 @@ if (onnxruntime_USE_CUDA) endif() endif() endif() + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --relocatable-device-code=true") + set(CMAKE_CUDA_SEPARABLE_COMPILATION ON) set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr") if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11) set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --Werror default-stream-launch")