Skip to content

Instantly share code, notes, and snippets.

@leemm
Last active February 16, 2023 23:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leemm/ab82d8bb91f899b3540787155524d776 to your computer and use it in GitHub Desktop.
Save leemm/ab82d8bb91f899b3540787155524d776 to your computer and use it in GitHub Desktop.
Installing and configuring nvidia drivers in clean Elementary OS 6.x install, including gamemode and prime-run (if indemand)
To install nvidia drivers (based on 515.48.07 at the time of writing) in a clean elementary os 6.1 Jolnir install. DON'T use the driver listed in the eos store.
// Install the toolchain
sudo apt install build-essential
sudo apt install software-properties-gtk
sudo apt install software-properties-common
sudo apt install linux-headers-$(uname -r)
// Install the drivers
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo dpkg --add-architecture i386
sudo apt update && sudo apt upgrade
sudo apt install nvidia-driver-510
sudo apt install libvulkan1 libvulkan1:i386 // if you have a vulkan capable gpu
// Missing 32bit? install cuda may help
https://linuxconfig.org/how-to-install-cuda-on-ubuntu-20-04-focal-fossa-linux
//If nvidia-smi results in NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running:
sudo dkms remove nvidia/515.48.07 --all
sudo dkms install --force nvidia/515.48.07 -k $(uname -r)
sudo update-initramfs -u
sync
reboot
// Check it's working
sudo prime-select query
nvidia-smi
nvidia-settings // don't recommend using this on a hybrid system but it's useful to detect the driver is working
sudo modprobe nvidia
prime-run glmark2
// For on-demand mode
sudo prime-select on-demand
// If the nvidea OR linux version updates and the driver fails, or you get stuck at command/terminal prompt when booting
sudo apt purge linux-headers-$(uname -r)
sudo apt install linux-headers-$(uname -r)
// Info gathered from various sources but most useful was here
https://forums.developer.nvidia.com/t/nvidia-smi-has-failed-because-it-couldn-t-communicate-with-the-nvidia-driver-after-updating-ubuntu-20-04/170985/6
// Limiting framerate (proton)
DXVK_FRAME_RATE=60 %command%
// Issues with gamemode? Remove it and install for deb files instead.
sudo apt remove *gamemode* --autoremove
wget http://ftp.debian.org/debian/pool/main/g/gamemode/gamemode_1.7-2+b1_amd64.deb http://ftp.debian.org/debian/pool/main/g/gamemode/gamemode-daemon_1.7-2+b1_amd64.deb http://ftp.debian.org/debian/pool/main/g/gamemode/libgamemode0_1.7-2+b1_amd64.deb http://ftp.debian.org/debian/pool/main/g/gamemode/libgamemodeauto0_1.7-2+b1_amd64.deb http://ftp.debian.org/debian/pool/main/g/gamemode/libgamemode0_1.7-2+b1_i386.deb http://ftp.debian.org/debian/pool/main/g/gamemode/libgamemodeauto0_1.7-2+b1_i386.deb
sudo apt install ./gamemode_1.7-2+b1_amd64.deb ./gamemode-daemon_1.7-2+b1_amd64.deb ./libgamemode0_1.7-2+b1_amd64.deb ./libgamemode0_1.7-2+b1_i386.deb ./libgamemodeauto0_1.7-2+b1_amd64.deb ./libgamemodeauto0_1.7-2+b1_i386.deb
rm ./gamemode_1.7-2+b1_amd64.deb ./gamemode-daemon_1.7-2+b1_amd64.deb ./libgamemode0_1.7-2+b1_amd64.deb ./libgamemode0_1.7-2+b1_i386.deb ./libgamemodeauto0_1.7-2+b1_amd64.deb ./libgamemodeauto0_1.7-2+b1_i386.deb
// My gamemode install had an error to do with permissions on /sys/class/powercap/intel-rapl*/*/energy_uj
https://github.com/FeralInteractive/gamemode/issues/337 has a workaround
// prime-run script - make it executable
https://gist.github.com/abenson/a5264836c4e6bf22c8c8415bb616204a
// Switch to a kernel with fsync enabled
sudo add-apt-repository ppa:damentz/liquorix && sudo apt-get update
sudo apt-get install linux-image-liquorix-amd64 linux-headers-liquorix-amd64
reboot
// Fix Suspend
https://askubuntu.com/questions/1345073/suspend-not-working-properly-cannot-wake-up-on-ubuntu-20-04-with-nvidia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment