Setting up Nvidia Driver 510 on Ubuntu 20.04.4 LTS
Steps to setup my laptop with Nvidia GeForce RTX 3070 Ti using the Nvidia 510 driver and 12th Gen Intel CPU. Note this is not the only way to do it, just a way that worked for me:
nomodesetis not in the kernel boot parameters (
nomodesetresulted in my machine freezing / not accepting input.
- Ensure that you do not run
nvidia-xconfig/ create an
xorg.conf. I noticed troubles with my display, such as a black box around the mouse and freezing at login time, when I used
nvidia-xconfigfor this OS/driver version.
- Install the Nvidia driver from Software & Updates. I went with the server version, which is
sudo apt-mark hold nvidia-driver-510(or
nvidia-driver-510-server) if you'd rather not get automatic updates. Optionally, check if any older Nvidia packages are lingering with
apt list --installed | grep nvidia | grep -v 510and remove unwanted packages from the previous version (e.g. 470).
- Blacklist nouveau by writing a file in
/etc/modprobe.d/blacklist-nvidia-nouveau.confwith the following contents:
options nouveau modeset=0
- Shutdown the machine.
- If you have integrated graphics/iGPU (if you have something besides your Nvidia card in
lspci | grep VGAyou may have an iGPU): Go into the BIOS, and disable hybrid graphics. Otherwise, I ran into issues where xorg would sometimes decide there was no display, and it simplified having the Nvidia driver be the chosen GPU. I'm sure there are other workarounds.
- Turn the machine back on.