- Ubuntu 24.04
- Secure Boot enabled
- Internet connection
- Administrator (sudo) privileges
- Remove any existing NVIDIA installations
sudo apt-get remove --purge '^nvidia-.*'
sudo apt autoremove
sudo reboot
- Install required dependencies and add the graphics drivers PPA
sudo apt update
sudo apt install build-essential dkms
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
- Install the NVIDIA open-source driver
sudo apt install nvidia-driver-570-open
- Install CUDA 12.8
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
sudo apt install cuda-toolkit-12-8
- Sign the NVIDIA modules for Secure Boot
First, generate a signing key:
# Create a directory for the keys if it doesn't exist
sudo mkdir -p /var/lib/shim-signed/mok/
# Generate a new key pair
sudo openssl req -new -x509 -newkey rsa:2048 -keyout /var/lib/shim-signed/mok/MOK.priv -outform DER -out /var/lib/shim-signed/mok/MOK.der -nodes -days 36500 -subj "/CN=NVIDIA Driver Module Key/"
# Import the key into the MOK manager
sudo mokutil --import /var/lib/shim-signed/mok/MOK.der
- When prompted to input and confirm a password, create a simple one that you'll remember for the MOK enrollment process during boot
- This password is only needed once during the next boot and can be different from your system password
- The above steps generate a signing key and register it with the MOK (Machine Owner Key) system for Secure Boot
- Reboot the system
sudo reboot
- Complete the MOK enrollment
- During boot, you'll see a blue MOK management screen
- Select "Enroll MOK"
- Choose "Continue"
- Enter the password you created in step 5
- Select "Yes" to enroll the key
- Your system will continue booting
- Verify the installation
nvidia-smi
You should now see your GPU information displayed.
- Set up CUDA environment variables
Add these lines to your
~/.bashrc
:
export PATH=/usr/local/cuda-12.8/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.8/lib64:$LD_LIBRARY_PATH
- Apply the changes
source ~/.bashrc
- Verify CUDA installation
nvcc --version
After successful installation, nvidia-smi
should show output similar to this:
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.144 Driver Version: 570.144 CUDA Version: 12.8 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 5070 Ti Off | 00000000:01:00.0 On | N/A |
| 0% 42C P5 24W / 300W | 857MiB / 16303MiB | 25% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
This output confirms:
- Driver version 570.144 is properly installed
- CUDA 12.8 is recognized
- The RTX 5070 Ti is properly detected and functioning
- The GPU is actively being used for display and compute tasks
- This installation uses the open-source NVIDIA kernel modules which are compatible with Secure Boot
- The driver version (570) is specifically for the RTX 50-series GPUs
- If you need to install PyTorch with CUDA 12.8 support, use:
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu128
- If
nvidia-smi
fails after reboot, verify that Secure Boot is properly configured and the MOK enrollment was successful - For any "Key was rejected by service" errors, ensure you completed the MOK enrollment process during boot
- If you encounter any issues with the display manager, you can restart it with:
sudo systemctl restart display-manager.service
This guide has been tested with RTX 5070 Ti on Ubuntu 24.04 with Secure Boot enabled. The process should be similar for other RTX 50-series GPUs.