mynote/linux/nvidia_driver.md
2024-05-23 16:11:06 +08:00

44 lines
1.2 KiB
Markdown

# ubuntu22 install 4090 dirver
## ubuntu server
```bash
sudo apt install nvidia-driver-550-server nvidia-utils-550-server
reboot
nvidia-smi
```
```bash
sudo apt install pkg-config libglvnd-dev gcc-12 make
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
sudo systemctl set-default multi-user.target
sudo reboot -h now
sudo ./NVIDIA-Linux-x86_64-535.171.04.run
sudo systemctl set-default graphical.target
sudo reboot -h now
```
## cuda
https://developer.nvidia.com/cuda-toolkit-archive
https://developer.nvidia.com/cuda-12-1-1-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local
```bash
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.1.1/local_installers/cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt update
sudo apt -y install cuda
```