Cuda backend fails to build

Hello everyone, I’m trying to build cuda backend on Ubuntu 22.04.4 LTS Jammy, I have Cuda compilation tools, release 11.5, V11.5.119 installed and NVIDIA-SMI 535.171.04 Driver Version: 551.78 CUDA Version: 12.4. But I get the following error
Building CUDA object src/CMakeFiles/tfhe_cuda_backend.dir/device.cu.o
/home/claoo/Projects/rust/tfhe-rs/backends/tfhe-cuda-backend/cuda/src/device.cu(91): error: identifier “cudaDevAttrClusterLaunch” is undefined

1 error detected in the compilation of “/home/claoo/Projects/rust/tfhe-rs/backends/tfhe-cuda-backend/cuda/src/device.cu”.
make[2]: *** [src/CMakeFiles/tfhe_cuda_backend.dir/build.make:107: src/CMakeFiles/tfhe_cuda_backend.dir/device.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:116: src/CMakeFiles/tfhe_cuda_backend.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
Does any of you knows what is the issue. I’m using Ubuntu over Windows 11 with WSL. can this be the issue?

Hello!

Are you on the latest main? What is your GPU model?

Cheers,
Agnès

Hi, yes I’m using the latest main and I see that the file with the issue was modified one week ago, and is also a comment on that specific line of code. My GPU is NVIDIA GeForce RTX 3060.

Thx,
Claoo

May I ask you to try and build on this branch: chore/gpu/tbcchecksupport, see if it fixes compilation for you? Thank you :pray:

this time I get a different error
– The CXX compiler identification is GNU 11.4.0
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /usr/bin/c++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Looking for a CUDA compiler
– Looking for a CUDA compiler - /usr/bin/nvcc
– The CUDA compiler identification is NVIDIA 11.5.119
– Detecting CUDA compiler ABI info
– Detecting CUDA compiler ABI info - done
– Check for working CUDA compiler: /usr/bin/nvcc - skipped
– Detecting CUDA compile features
– Detecting CUDA compile features - done
– CUDA Architecture: -arch=sm_86
– CUDA Version:
– CUDA Path:
– CUDA Libraries:
– CUDA Performance Primitives:
– Found OpenMP_CXX: -fopenmp (found version “4.5”)
– Found OpenMP: TRUE (found version “4.5”)
– Configuring done (7.0s)
– Generating done (0.0s)
– Build files have been written to: /home/claoo/Projects/tfhe-rs/backends/tfhe-cuda-backend/cuda/build
claoo@DESKTOP-6SHLCUU:~/Projects/tfhe-rs/backends/tfhe-cuda-backend/cuda/build$ make
[ 3%] Building CUDA object src/CMakeFiles/tfhe_cuda_backend.dir/crypto/ciphertext.cu.o
[ 6%] Building CUDA object src/CMakeFiles/tfhe_cuda_backend.dir/crypto/keyswitch.cu.o
[ 10%] Building CUDA object src/CMakeFiles/tfhe_cuda_backend.dir/device.cu.o
[ 13%] Building CUDA object src/CMakeFiles/tfhe_cuda_backend.dir/fft/twiddles.cu.o
[ 17%] Building CUDA object src/CMakeFiles/tfhe_cuda_backend.dir/integer/bitwise_ops.cu.o
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
|
^
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
|
^
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
make[2]: *** [src/CMakeFiles/tfhe_cuda_backend.dir/build.make:137: src/CMakeFiles/tfhe_cuda_backend.dir/integer/bitwise_ops.cu.o] Error 1
claoo@DESKTOP-6SHLCUU:~/Projects/tfhe-rs/backends/tfhe-cuda-backend/cuda/build$
make: *** [Makefile:146: all] Error 2

Have you followed this guide for Cuda installation on WSL? CUDA on WSL

(Cuda download page: CUDA Toolkit 12.4 Update 1 Downloads | NVIDIA Developer)

1 Like

Thank you very much, problem solved. I reinstall everything from scratch and I manage to build cuda backend.
Happy coding!

1 Like