Thursday, January 19, 2023

Cinnamon Desktop / Gnome Desktop Nvidia Graphic Driver Fix

I switched to Cinnamon Desktop a few days ago and did my first update today.  After the update I started getting an error when I logged on saying  "Your system is currently running without video hardware acceleration, you may experience poor performance and high CPU usage".  I noticed a Kernel Update during the update which was a clue to what happened.  I also booted to Gnome Desktop and noticed my Nvidia drivers were not working nor would they reinstall. In both Cinnamon and Gnome Desktop in Additional Drivers, section it showed Nvidia drivers active but system info showed X.ORG X or Nouveau drivers were in use.  In Steam all my games were running at 1 or 2 frames a second.  In addition I noticed that my option to logon to Gnome Wayland Desktop was missing as an option too.

To fix your Nvidia drivers if they broke after a kernel update it may be caused by missing headers. To fix the missing headers open a Terminal Window and type the following command:

sudo apt install linux-headers-$(uname -r)

After rebooting, the above command fixed all my Nvidia driver problems.  Below, in the Trouble Shooting Section, are some of the commands and tools I used trying to solve this problem.


Trouble Shooting Section:

If missing headers are not your troubles here are a few thing to help you diagnose the problem.  Open a Terminal Window and type:

inxi -Fxxxz

This will display a very useful and long list of things about your system.  For our purpose we are only interested the GRAPHICS: section (see screen shot below for what a correct Nvidia install looks like)



This command will let you know if your system sees your video card.  If it doesn't it may be a problem in BIOS:

sudo lshw -C display




This command will display more information from the NVIDIA System Management Interface program.  It can do a lot more than display info so read it's manual here: Link to nvidia-smi PDF manualNote: that this command may not run if your Nvidia driver installation is broken.

nvidia-smi

Output of nvidia-smi on a working machine



This command will use nvidia-smi to display your Nvidia driver version:
 
nvidia-smi --query-gpu=driver_version --format=csv


To make changes to your Nvidia driver settings (launch Nvidia X Server Setting GUI) using the following command.  Leave out the SUDO if you just want to view setting in the GUI.

 sudo nvidia-settings


Sometimes you need to completely remove the Nvidia drivers to fix them.  To completely remove your Nvidia Drivers from your system with Terminal Commands type the following: 

sudo apt-get purge nvidia*
sudo apt --purge autoremove

After you removed your Nvidia drivers you will need to reinstall them.  To do this you will need to figure out what Nvidia drivers are available.  To do this use the following command to a list all Nvidia driver's names: 

apt-cache search 'nvidia-driver-' | grep '^nvidia-driver-[[:digit:]]*'



After you've found the driver version you want to install use the following three (3) commands to reinstall your Nvidia Drivers.  NOTE: Change the "nvidia-driver-525" part to the name of the driver you want to install ( the apt-cache search 'nvidia-driver-' | grep '^nvidia-driver-[[:digit:]]*' command above will provide you with the needed driver name)

sudo apt update
sudo apt upgrade
sudo apt install --reinstall nvidia-driver-525


Another, more complete, install command you can use in place of sudo apt install --reinstall nvidia-driver-525 is: (again replace the 525 with your desired version number) :

sudo apt install nvidia-driver-525 nvidia-dkms-525


Once you've installed/re-installed your desired driver version reboot your system with

sudo reboot


After the reboot, verify your driver install using the nvidia-smi command (above) to verify the installation.


Well that's it, that's everything I went through trying to fix the "Your system is currently running without video hardware acceleration, you may experience poor performance and high CPU usage" .  I had just switched to Cinnamon Desktop a couple of days ago and thought I'd ruined my system on it's first update.  I was getting ready to reinstall my complete operating system when I stumbled onto a solution to someone else's problem.  The "missing headers" was a suggestion to fix their problem.  It didn't work for them, but it did for me.





No comments: