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.
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
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.
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
4. Select this to generate a new key
8. This should be selected as no
Then when I entered nvidia-smi, it still didn’t pop up.
11. Look at these two images to find this .der file
sudo mokutil --import /usr/share/nvidia/nvidia*.der
You need to replace the * with the one on your computer.
Here, press tab for related prompts, and select the one ending with .der
12. You need to enter your password twice here.
After restarting, you will see the following interface; just press any key, I pressed enter.
14. Follow the images here for the operation.
You can see that the desktop content has become clear at this point.
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.
After installation, entering nvidia-smi should show more than just this one line in processes; it should look like this.
If you find that you installed it incorrectly, you need to uninstall the NVIDIA driver from your computer.
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.