How to install Nvidia Driver and CUDA on my Predator laptop GPU GeForce RTX 4070 安裝筆記 電競筆電 裝顯卡驅動

Standard

Solution to install both CUDA and Driver

sudo add-apt-repository ppa:graphics-drivers/ppa -y
sudo apt update && sudo apt upgrade

Go to cuda 12.4.0 installation page: https://developer.nvidia.com/cuda-12-4-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local

sudo apt-get install -y nvidia-driver-550-open
(remember to sign to the driver)
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.4.0/local_installers/cuda-repo-ubuntu2204-12-4-local_12.4.0-550.54.14-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-4-local_12.4.0-550.54.14-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-4-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-4
sudo apt-get install -y cuda-drivers-550
reboot

(dont do the following bios setup too early without nvidia driver installed or using the USB ubuntu)
press del or F2 during the starting up to enter Bios
press F1 go to advanced setup
Advanced > Display mode > from "Auto Select" to "Nvidia GPU only"
Security > Set Supervisor Password
Boot > Secure Boot > from "On" to "Off"
Security > Cancel Supervisor Password
Exit > Save and Exist

nvidia-smi 

Alternative way about driver (using run script)

find the driver according to your GPU card at: https://www.nvidia.com/en-us/drivers/
it may be 570.124.04, 550.144.03 or 535.230.02
download the file, it should be like NVIDIA-Linux-x86_64-550.144.03.run
sudo chmod +x NVIDIA-Linux-x86_64-550.144.03.run
./NVIDIA-Linux-x86_64-550.144.03.run
then install the CUDA

0 comments:

張貼留言

留言