Ubuntu 22.04中安裝nvidia-driver-545 & CUDA-12.3|Install nvidia-driver-545 & CUDA-12.3.2 in Ubuntu 22.04

Cyborg-15-A12VE — NVIDIA GeForce RTX 4050

yuhsi chen
2 min readJan 6, 2024

1️⃣Install nvidia driver 545
2️⃣Install cuda-12.3.2
Acknowledgments and References

1️⃣Install nvidia driver 545

$ sudo lshw -numeric -C display
$ sudo apt-get purge nvidia*
$ sudo add-apt-repository ppa:graphics-drivers
$ sudo apt-get update
$ sudo apt upgrade
$ ubuntu-drivers list
$ sudo apt install nvidia-driver-545
$ reboot
nvidia-smi

↪Back to the content⤴

2️⃣Install cuda-12.3.2

# https://developer.nvidia.com/cuda-toolkit-archive
$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
$ sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
$ wget https://developer.download.nvidia.com/compute/cuda/12.3.2/local_installers/cuda-repo-ubuntu2204-12-3-local_12.3.2-545.23.08-1_amd64.deb
$ sudo dpkg -i cuda-repo-ubuntu2204-12-3-local_12.3.2-545.23.08-1_amd64.deb
$ sudo cp /var/cuda-repo-ubuntu2204-12-3-local/cuda-*-keyring.gpg /usr/share/keyrings/
$ sudo apt-get update
$ sudo apt-get -y install cuda-toolkit-12-3
$ vim ~/.bashrc
>> export PATH=/usr/local/cuda/bin:$PATH
>> export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
$ source ~/.bashrc
nvcc -V

↪Back to the content⤴

Acknowledgments and References

↪Back to the content⤴

--

--