Checking gpu
lspci | grep -i nvidia
Installing newest kernel and pkgs
apt update && apt upgrade
reboot...
Installing Nvidia gpu driver
apt install ubuntu-drivers-common
ubuntu-drivers devices
ubuntu-drivers list
apt remove xserver-xorg-video-nouveau && apt autoremove
ubuntu-drivers install
Installing Nvidia CUDA repo Keyring
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2604/x86_64/cuda-keyring_1.1-1_all.deb
dpkg -i cuda-keyring_1.1-1_all.deb
Updating apt repo list
apt-get update
Installing CUDA-toolkit 13.4.x
apt-get -y install cuda-toolkit-13-4
Adding cuda path file
vim /etc/profile.d/cuda.sh
export CUDA_HOME=/usr/local/cuda
export PATH=${CUDA_HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
Reboot then check driver and cuda-toolkit has had enable
reboot...
cat /proc/driver/nvidia/version
nvidia-smi
nvcc --version
Ref:
1.https://linuxcapable.com/how-to-install-cuda-on-ubuntu-linux/
2.https://linuxize.com/post/how-to-install-nvidia-cuda-toolkit-on-ubuntu-26-04/