ctranslate2: don't set default nvcc arch flags#536525
Conversation
This fixes a build failure when using cudaPackages_13: > Unsupported gpu architecture 'compute_53'
|
How are the desired set of CUDA capabilities passed to CMake? I would have expected setting CUDA_ARCH_LIST in cmakeFlagsArray (contains whitespace, cmakeFlags if structured attributes are enabled) using some of the values from cudaPackages.flags. |
|
They use the deprecated FindCuda cmake module, specifically the cuda_select_nvcc_arch_flags() described here: https://cmake.org/cmake/help/latest/module/FindCUDA.html As far as I can see, the format cuda_select_nvcc_arch_flags() accepts doesn't match any currently available thing under By the way, is there a standard for when/if we should set the CUDA architectures in build systems? Is it just if it's convenient and someone remembers to? Or are you trying to be more complete? |
|
This should work: cmakeFlags = ... ++ [ (lib.cmakeFeature "CUDA_ARCH_LIST" (builtins.toString cudaPackages.flags.cudaCapabilities) ](use CUDA architectures should always be provided to the build system when CUDA support is enabled. |
|
I get the following error when setting CUDA_ARCH_LIST: It looks like FindCUDA doesn't even accept double digit major version numbers based on the regex here. I assume they just arent putting in any additional effort to FindCUDA given that it's deprecated. |
|
Also, it looks like there's ongoing work to migrate to the newer cmake support here: OpenNMT/CTranslate2#2067 |
The package uses CMake's legacy FindCUDA module, whose cuda_add_library reads GPU arch flags only from CUDA_NVCC_FLAGS and ignores the CMAKE_CUDA_ARCHITECTURES set by setupCudaHook. Since NixOS#536525 stopped populating CUDA_NVCC_FLAGS, nvcc falls back to its default (sm_52 on CUDA 12) and the fp16 AWQ kernels fail ptxas (need sm_53+). Feed the configured gencode flags directly.
|
Based on the build failure issues linked I'm inclined to revert. |
|
Feel free to resubmit when the CUDA issues are settled. |
The package uses CMake's legacy FindCUDA module, whose cuda_add_library reads GPU arch flags only from CUDA_NVCC_FLAGS and ignores the CMAKE_CUDA_ARCHITECTURES set by setupCudaHook. Since NixOS#536525 stopped populating CUDA_NVCC_FLAGS, nvcc falls back to its default (sm_52 on CUDA 12) and the fp16 AWQ kernels fail ptxas (need sm_53+). Feed the configured gencode flags directly.
The package uses CMake's legacy FindCUDA module, whose cuda_add_library reads GPU arch flags only from CUDA_NVCC_FLAGS and ignores the CMAKE_CUDA_ARCHITECTURES set by setupCudaHook. Since NixOS#536525 stopped populating CUDA_NVCC_FLAGS, nvcc falls back to its default (sm_52 on CUDA 12) and the fp16 AWQ kernels fail ptxas (need sm_53+). Feed the configured gencode flags directly.
The package uses CMake's legacy FindCUDA module, whose cuda_add_library reads GPU arch flags only from CUDA_NVCC_FLAGS and ignores the CMAKE_CUDA_ARCHITECTURES set by setupCudaHook. Since NixOS#536525 stopped populating CUDA_NVCC_FLAGS, nvcc falls back to its default (sm_52 on CUDA 12) and the fp16 AWQ kernels fail ptxas (need sm_53+). Feed the configured gencode flags directly.
The package uses CMake's legacy FindCUDA module, whose cuda_add_library reads GPU arch flags only from CUDA_NVCC_FLAGS and ignores the CMAKE_CUDA_ARCHITECTURES set by setupCudaHook. Since NixOS#536525 stopped populating CUDA_NVCC_FLAGS, nvcc falls back to its default (sm_52 on CUDA 12) and the fp16 AWQ kernels fail ptxas (need sm_53+). Feed the configured gencode flags directly.
The package uses CMake's legacy FindCUDA module, whose cuda_add_library reads GPU arch flags only from CUDA_NVCC_FLAGS and ignores the CMAKE_CUDA_ARCHITECTURES set by setupCudaHook. Since NixOS#536525 stopped populating CUDA_NVCC_FLAGS, nvcc falls back to its default (sm_52 on CUDA 12) and the fp16 AWQ kernels fail ptxas (need sm_53+). Feed the configured gencode flags directly.
The package uses CMake's legacy FindCUDA module, whose cuda_add_library reads GPU arch flags only from CUDA_NVCC_FLAGS and ignores the CMAKE_CUDA_ARCHITECTURES set by setupCudaHook. Since NixOS#536525 stopped populating CUDA_NVCC_FLAGS, nvcc falls back to its default (sm_52 on CUDA 12) and the fp16 AWQ kernels fail ptxas (need sm_53+). Feed the configured gencode flags directly.
This fixes a build failure when using cudaPackages_13:
Build failure originally reproduced with:
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.