To install CUDA you need to install the package “build-essentials”.
sudo apt install -y build-essential
Oobabooga text-generation webui wants CUDA 12.1 so I use this version in the scripts.
wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run
chmod +x cuda_12.1.1_530.30.02_linux.run
sudo ./cuda_12.1.1_530.30.02_linux.run
First you have to enter “accept” to accept the license. In the following installation dialog deselect the “driver” and start the installation.
After the installation the following script needs to be executed to add the needed lines to your
.bashrc
:
tee --append ~/.bashrc <<'EOF'
export PATH=/usr/local/cuda-12.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda
EOF
To activate these changes, enter:
source ~/.bashrc
Under Xubuntu 24.10 you can install CUDA 12.1 easier:
sudo apt install nvidia-cuda-toolkit