[Build] compute_arch deprecation not accounted for in CUDA v12
Description
When automatic GPU detection fails, PTX code will be compiled for a list of common targets: https://github.com/arrayfire/arrayfire/blob/138f12e9f181b8a7bd013323137931aec0f3bd59/CMakeModules/select_compute_arch.cmake#L33
This list is modified by various CUDA version checks to account for deprecation, eg:
https://github.com/arrayfire/arrayfire/blob/138f12e9f181b8a7bd013323137931aec0f3bd59/CMakeModules/select_compute_arch.cmake#L83
Proposed fix
Add similar checks for CUDA 12 to allow build.
Edit: Further debugging revealed that CUDA_COMMON_ARCHITECTURES is in fact being correctly created (even on CUDA v12) with deprecated architectures removed, but it happens too late, and then gets mysteriously overwritten later on.
The following screenshots shows debug prints for CUDA_COMMON_ARCHITECTURES at various stages:
- After the last version check that removes depecrated compute architectures https://github.com/arrayfire/arrayfire/blob/138f12e9f181b8a7bd013323137931aec0f3bd59/CMakeModules/select_compute_arch.cmake#L95
- At the begining of
function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)https://github.com/arrayfire/arrayfire/blob/138f12e9f181b8a7bd013323137931aec0f3bd59/CMakeModules/select_compute_arch.cmake#L112
Error Log
nvcc fatal : Unsupported gpu architecture 'compute_35'
Build Environment
Compiler version: clang version 10.0.0-4ubuntu1 Operating system: Ubuntu 22.04 (WSL) Build environment: CUDA 12.0, vcpkg
Hey @mikex86,
Can you try to build the latest master or v3.8.3. I believe we have updated that functionallity to support the newer toolkits and addressed the inclusion of the older architectures in CUDA 12.