This section applies to machines with Secure Boot, such as ThinkPad.
- Before installation, switch to "Discrete Graphics" in BIOS, if both Intel and Nvidia graphics are present.
- During installation, make sure to select the "Install third-party software for graphics and Wi-Fi hardware and addition media formats" in "Updates and other software" screen.
- Select "Configure Secure Boot", and set password.
- Continue Ubuntu installation as normal.
- During the first reboot, "Perform MOK management" screen will showup. Select "Enroll MOK" option.
- Select "Continue", then, "Yes".
- "Enroll the key(s)?" screen will present. Enter the password from Step 3.
- "OK" to reboot.
- Once login to the Desktop, do the following to update the Nvidia driver.
Select existing Window 10 boot partition as Ubuntu EFI target. GRUB will look after the rest.
## check display card and driver status
sudo lshw -c display
# or sudo lshw -c video
## check loaded display card and driver
lsmod | grep nvidia
# or nvidia-smi
# or lsmod | grep nouveau
## remove old Nvidia driver
sudo apt purge nvidia-*
# or sudo apt remove nvidia-*
## add driver repository
sudo add-apt-repository ppa:graphics-drivers/ppa
## identify suitable driver version
sudo ubuntu-drivers devices
## if ubuntu-drivers command not found
sudo apt install ubuntu-drivers-common
## install drivers from ppa database
sudo apt install nvidia-driver-430
# sudo apt install nvidia-XYXYX nvidia-settings
# v430 was the recommended and the latest by writing this gist
## this installs drivers from Nvidia
wget http://us.download.nvidia.com/tesla/418.67/NVIDIA-Linux-x86_64-418.67.run
# or wget http://us.download.nvidia.com/XFree86/Linux-x86_64/418.74/NVIDIA-Linux-x86_64-418.74.run
# supporting packages may need to be installed before running following
sudo bash ./NVIDIA-Linux-x86_64-418.67.run --dkms
## reboot
sudo reboot
## check driver details and settings
nvidia-smi or nvidia-settings
## select driver
prime-select query
sudo prime-select nvidia or sudo prime-select intel
## display usage
dpkg -L nvidia-driver-430
If it's not working by the above steps, try the followings.
## try 1
xrandr --setprovideroutputsource modesetting NVIDIA-0 && xrandr --auto
## try 2
grep modeset /etc/modprobe.d/*
# and
grep modeset /lib/modprobe.d/*
# to find the file containing
# options nvidia-drm modeset=1
# change it to
# options nvidia-drm modeset=0
# run
sudo update-initramfs -u
reboot
# check if the external monitor works
Note: try 2 works for ThinkPad X1 Extreme.
# on Linux
timedatectl set-local-rtc 1 --adjust-system-clock
- install Nvidia drivers ubuntu 18.04 with secure boot
- Systemtap UEFI Secure Boot Support
- DKMS
- HDMI output missing in xrandr command and external monitor does not work
- How to Fix Windows and Linux Showing Different Times When Dual Booting
- AWS EC2
The above steps also suitable for enabling CUDA support on AWS GPU instances, such as g3 and p3 EC2 instances.
For RHEL user, please check this link.
@okapetanios - sorry to necro this old thread, but i did the same thing and found this command to bring back the mok screen:
References
https://askubuntu.com/questions/1122855/mok-manager-nvidia-driver-issue-after-cuda-install