CFD-GO / TCLB

TCLB - Templated MPI+CUDA/CPU Lattice Boltzmann code
https://tclb.io
GNU General Public License v3.0
178 stars 70 forks source link

landing instruction --with-cuda-arch=sm_30 is dropped from CUDA 10.2. #422

Closed ggruszczynski closed 1 year ago

ggruszczynski commented 1 year ago

I found that the landing instruction https://github.com/CFD-GO/TCLB is not working

My configuration:

make configure
./configure --enable-graphics --with-cuda-arch=sm_30

I get this error:

$ make d2q9
...
...
nvcc fatal   : Value 'compute_30' is not defined for option 'gpu-architecture'
make[1]: *** [makefile:63: cross.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/user/GITHUB/LBM/TCLB/CLB/d2q9'
make: *** [makefile.main:20675: CLB/d2q9/main] Error 2

$ nvcc --version                    
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

Reason

Support for compute_30 has been removed for versions after CUDA 10.2.

https://stackoverflow.com/questions/64774548/unsupported-gpu-architecture-compute-30-on-a-cuda-5-capable-gpu

https://docs.nvidia.com/cuda/archive/10.2/pdf/CUDA_Toolkit_Release_Notes.pdf

I suggest pushing up the instruction to sm_60 (Pascal, next after sm_30 in TCLB config), as Maxwell (sm_50) is also deprecated from CUDA 11.6 onwards: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/

llaniewski commented 1 year ago

I decided to change this mechanism, for TCLB to ask the GPU for the CC, and if that fail, just regress to nvcc default. Of course one will be still able to specify the CC by hand with --with-cuda-arch=, but now it will accept whatever you give it. the changes are here: https://github.com/llaniewski/TCLB/compare/feature/hip...llaniewski:TCLB:feature/sm_auto?expand=1

I will test it and then modify the readme and pull request (this combines with #376 )

llaniewski commented 1 year ago

Merged in #376