Installing NVIDIA Drivers on Linux: Common Pitfalls

Let’s discuss the biggest pitfalls I encountered while installing NVIDIA drivers on Linux.
Just because your desktop looks clearer after installation and nvidia-smi displays content does not mean the driver is installed correctly.
I initially followed an online tutorial for the installation, and while everything seemed fine, when I entered nvidia-smi, the gnome-shell process was missing from the processes list.
This means if you only see /usr/bin/xorg/xorg, congratulations, you’ve installed it incorrectly, haha, uninstall and reinstall.
Installing NVIDIA Drivers on Linux: Common Pitfalls
Then I used ROS‘s Gazebo simulation, which had a very low frame rate of 6fps, indicating the driver was not installed correctly.
I initially followed this blog for installation.
https://blog.csdn.net/BZ_PP/article/details/120027480
Installing NVIDIA Drivers on Linux: Common Pitfalls
I directly gave the downloaded .run file the necessary permissions and proceeded without the previous steps, which ultimately resulted in the NVIDIA driver being useless.
Here are the specific screenshots from my last installation. If you are installing, please follow my blog from start to finish. I think that should resolve any issues.
Installing NVIDIA Drivers on Linux: Common Pitfalls
Now I believe it’s essential to close the graphical interface and only open it after the installation is complete.
The following content shows the relevant images from my first installation of the NVIDIA driver, where the options selected were correct; you can take a look.
1. Give the .run file permissions and run the .run file
sudo ./NVIDIA-Linux-x86_64-550.142.run -no-x-check -no-nouveau-check -no-opengl-files 
sudo ./NVIDIA-Linux-x86_64-550.142.run -no-x-check -no-nouveau-check -no-opengl-files 
Installing NVIDIA Drivers on Linux: Common Pitfalls
2.
Installing NVIDIA Drivers on Linux: Common Pitfalls
Wait a moment
Installing NVIDIA Drivers on Linux: Common Pitfalls
3. Select this
Installing NVIDIA Drivers on Linux: Common Pitfalls
4. Select this to generate a new key
Installing NVIDIA Drivers on Linux: Common Pitfalls
5. Select no
Installing NVIDIA Drivers on Linux: Common Pitfalls
6. ok
Installing NVIDIA Drivers on Linux: Common Pitfalls
7. Select this install
Installing NVIDIA Drivers on Linux: Common Pitfalls
8. This should be selected as no
Installing NVIDIA Drivers on Linux: Common Pitfalls
Wait a moment
Installing NVIDIA Drivers on Linux: Common Pitfalls
9. Select yes
Installing NVIDIA Drivers on Linux: Common Pitfalls
10. ok
Installing NVIDIA Drivers on Linux: Common Pitfalls
Then when I entered nvidia-smi, it still didn’t pop up.
Installing NVIDIA Drivers on Linux: Common Pitfalls
11. Look at these two images to find this .der file
Enter
sudo mokutil --import /usr/share/nvidia/nvidia*.der
You need to replace the * with the one on your computer.
Installing NVIDIA Drivers on Linux: Common Pitfalls
Installing NVIDIA Drivers on Linux: Common Pitfalls
Here, press tab for related prompts, and select the one ending with .der
Installing NVIDIA Drivers on Linux: Common Pitfalls
12. You need to enter your password twice here.
Installing NVIDIA Drivers on Linux: Common Pitfalls
13. Restart
Installing NVIDIA Drivers on Linux: Common Pitfalls
After restarting, you will see the following interface; just press any key, I pressed enter.
Installing NVIDIA Drivers on Linux: Common Pitfalls
14. Follow the images here for the operation.
Installing NVIDIA Drivers on Linux: Common Pitfalls
Installing NVIDIA Drivers on Linux: Common Pitfalls
Installing NVIDIA Drivers on Linux: Common Pitfalls
Installing NVIDIA Drivers on Linux: Common Pitfalls
Installing NVIDIA Drivers on Linux: Common Pitfalls
You can see that the desktop content has become clear at this point.
Installing NVIDIA Drivers on Linux: Common Pitfalls
When I entered nvidia-smi, I found that the Processes section only had one line, indicating that the NVIDIA driver was indeed not installed properly.
Installing NVIDIA Drivers on Linux: Common Pitfalls
After installation, entering nvidia-smi should show more than just this one line in processes; it should look like this.
Installing NVIDIA Drivers on Linux: Common Pitfalls
If you find that you installed it incorrectly, you need to uninstall the NVIDIA driver from your computer.
Command:
sudo /usr/bin/nvidia-uninstall
You can also check this blog:
https://www.cnblogs.com/to-here/p/18289364
This blog discusses the commands for enabling and disabling the graphical interface.
Finally, I opened Gazebo and RViz, and the fps was normal again.
Installing NVIDIA Drivers on Linux: Common Pitfalls
Installing NVIDIA Drivers on Linux: Common Pitfalls

Leave a Comment