As expected, Nvidia drivers have reduced my customizations. I can't login to Unity 3D session. I can't find any content to help me to uninstall the driver and I don't know what to do as I have never uninstalled them before.
Ubuntu – How to uninstall a nvidia driver completely
nvidiauninstallunity
Related Solutions
Okay I have finally found a solution for the problem!
Thanks to these threads:
- http://www.bleepingcomputer.com/forums/t/549534/nvidia-drivers-how-to-install-it-in-ubuntu-14041204/
- http://www.reddit.com/r/linux_gaming/comments/2gk0dh/problem_with_installing_nvidia_drivers_on_840m/
The solution is:
When the computer has booted up and you see the black screen press ctrl+alt+F1 and log in with your user account.
Edit your xorg.conf with sudo nano /etc/X11/xorg.conf
Find the line that says: Section "Screen"
Insert a new line that says UseDisplayDevice "DFP"
Save with ctrl+o+Enter and exit with ctrl+x
Next install bumblebee with sudo apt-get install bumblebee
.
Then reboot sudo reboot
Pay your attention to ubuntu-drivers devices
command output - there are following lines:
driver : nvidia-340 - third-party free
driver : nvidia-driver-390 - third-party free
driver : nvidia-driver-396 - third-party free recommended
driver : xserver-xorg-video-nouveau - distro free builtin
The lines mean you can use nvidia 340, 390, 396 drivers from third-party repository and open-source nouveau driver from distro repository. Only one driver is recommended to you. The list doesn't mean all of the mentioned drivers has been installed in your system. It indicates only potential possibility to install the drivers. The list can't be changed manually as being formed with ubuntu-drivers
utility designed to automate proprietary drivers detecting, inspecting and installing from available to Ubuntu repositories.
Thus, to change the list it's necessary to remove third-party repository, which is proprietary GPU drivers repo in the particular case. But it's highly unrecommended to do, since your goal is to keep nvidia 396 driver anyway and remove from automatically created list nvidia 340 and 390 drivers. If you remove the third-party repository, only distro drivers will be detected as available, which will be in the particular case only 340 and 390 - thus, you'll obtain most undesired for you situation.
My suggestion for you is to do nothing. Your system looks healthy, everything works well.
If you like experiments, follow guide below.
The described below is for experimental purposes only - if you're not sure don't do it!
Press Ctrl+Alt+F4, log in and remove all of the nvidia staff:
sudo apt remove nvidia-*
Next remove proprietary PPA GPU drivers repository. Run in terminal:
sudo add-apt-repository --remove ppa:graphics-drivers/ppa
sudo apt update
Afterwards check available drivers in terminal:
ubuntu-drivers devices
You'll see the third-party nvidia drivers have dissapeared and only distro nvidia drivers are available. Among the drivers nvidia 396 will be absent since the driver isn't a part of Ubuntu distro repository.
Add your PPA proprietary GPU drivers repository back:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
Install your desired nvidia 396 again:
sudo ubuntu-drivers autoinstall
Reboot:
sudo reboot
After reboot, type nvidia-smi
which will show different information about your graphic card like below:
xyz@xyz-workstation:~$ nvidia-smi
Mon Apr 27 12:41:50 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64.00 Driver Version: 440.64.00 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 166... On | 00000000:01:00.0 Off | N/A |
| N/A 45C P8 1W / N/A | 470MiB / 5944MiB | 5% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1905 G /usr/lib/xorg/Xorg 28MiB |
| 0 2058 G /usr/bin/gnome-shell 47MiB |
| 0 2956 G /usr/lib/xorg/Xorg 145MiB |
| 0 3133 G /usr/bin/gnome-shell 120MiB |
| 0 3587 G ...AAAAAAAAAAAACAAAAAAAAAA= --shared-files 122MiB |
+-----------------------------------------------------------------------------+
For systems having nvidia-prime, if it returns an error then type sudo prime-select intel
and then reboot and then type sudo prime-select nvidia
and then reboot again. Now type nvidia-smi
and it should work. This method works on most of the system with kernel till 5.4
Additionally see this my post.
Best Answer
For Ubuntu 12.04
Commands can be executed to terminal. You can open a terminal with Ctrl + Alt+T keys combo.
If you
remove --purge
the nvidia driver you will be OK. No need to blacklist something, but sometimes maybe a force-load of the nouveau module needed.First uninstall completely the driver.
Search what packages from nvidia you have installed.
except the package
nvidia-common
all other packages should be purged.If you want to be sure that you will purge everything related to nvidia you can give this command
the
.*
in the end means (Purge everything that begins (^
) with the namenvidia-
)BUT
above command will also remove the
nvidia-common
package and thenvidia-common
package has as a dependency theubuntu-desktop
package.So after above command you should also give the installation command for
ubuntu-desktop
packageAlso sometimes the nouveau driver get blacklisted from nvidia driver. With purge command it should UN-blacklisted. If you want to be sure that nouveau will be load in boot, you can force-load it by add it to /etc/modules
Last , search for the xorg.conf file and remove it as well
In summary
Although all above commands not needed, this is my way to completely purge the nvidia driver and use the open source nounveau.