Implement sanity check in EasyBuild for CUDA compute capabilities

You can dump the architectures for which something has been compiled using cuobjdump --dump-ptx. This could be used to implement a sanity check in EasyBuild on the actual CUDA compute capabilities that ended up in an executable, and check if they match what was set in --cuda-compute-capabilities.

Example on a library that is part of CUDA 12.1 (and thus is a fat binary that supports every architecture from sm50 to sm90):

$ cuobjdump --dump-ptx /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen2/accel/nvidia/cc80/software/CUDA/12.1.1/lib64/libcusparse.so | head -n 300 | grep arch
arch = sm_50
arch = sm_52
arch = sm_60
arch = sm_61
arch = sm_70
arch = sm_75
arch = sm_80
arch = sm_86
arch = sm_89
arch = sm_90
arch = sm_50
arch = sm_52
arch = sm_60
arch = sm_61
arch = sm_70
arch = sm_75
arch = sm_80
arch = sm_86
arch = sm_89
arch = sm_90
arch = sm_90
arch = sm_50
arch = sm_52
arch = sm_60
arch = sm_61
arch = sm_70
arch = sm_75
arch = sm_80
arch = sm_86
arch = sm_89
arch = sm_90

I guess the sanity check could run on the same set of files that the RPATH sanity check is run on. It should of course be conditional on CUDA being a dependency, which can easily be checked by checking of the software root for CUDA is defined (see e.g. here).

Note that cuobjdump is part of the CUDA toolkit. So it does mean we have to load CUDA to run the sanity check. But I think the sanity check runs with all the dependencies loaded anyway, so that should just work (famous last words). One complication: for EESSI, it is just a build dependency, so not loaded when running the sanity check.

Edited by Caspar van Leeuwen