Installing NVIDIA Driver on Ubuntu 16.04 and 18.04

I am not sure if there were NVIDIA drivers when I installed Ubuntu 16.01 on a machine with Intel processor and GTX 1060 graphic card, but at least I saw this in the terminal (it is not clear what actually FAILED):

First I updated the system:

sudo apt-get update
sudo apt-get dist-upgrade
sudo reboot

Then, as described here, I did:

ubuntu-drivers devices
sudo apt-get install intel-microcode
sudo apt-get install nvidia-384

played a bit with Driver Manager, using the following commands:

sudo lshw -c video
sudo vainfo
sudo lspci

and now I have an impression that I am using NVIDIA driver:

It is not clear how to force P0 state, as I did on Windows. Currently my overclocked card on Windows 10 works on 17% effectively than not overclocked card on Linux, the average hashrate is 259H/s vs 213H/s, but the current hashrate is about 300 Sol/s vs 280 Sol/s.

On some other machine with Ubuntu 18.04 LTS I initially had:

$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001C02sv00001462sd00003287bc03sc00i00
vendor   : NVIDIA Corporation
model    : GP106 [GeForce GTX 1060 3GB]
driver   : nvidia-driver-390 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin

And after I did (this downloads g++ and builds something)

sudo apt-get install nvidia-driver-390
sudo reboot

I got

To uninstall NVIDIA driver I followed this instruction:

sudo apt-get remove --purge nvidia-*
sudo apt-get install ubuntu-desktop
sudo rm /etc/X11/xorg.conf
echo 'nouveau' | sudo tee -a /etc/modules

and got all the cards with nouveau:

There is also good instruction on installing the latest NVIDIA driver:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:1b.0/0000:02:00.0 ==
modalias : pci:v000010DEd00001C02sv00001462sd00003287bc03sc00i00
vendor   : NVIDIA Corporation
model    : GP106 [GeForce GTX 1060 3GB]
driver   : nvidia-driver-390 - third-party free
driver   : nvidia-driver-396 - third-party free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin
sudo ubuntu-drivers autoinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libffi6:i386 libnvidia-common-390 libwayland-client0:i386 libwayland-server0:i386
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnvidia-cfg1-396 libnvidia-common-396 libnvidia-compute-396 libnvidia-compute-396:i386 libnvidia-decode-396 libnvidia-decode-396:i386 libnvidia-encode-396
  libnvidia-encode-396:i386 libnvidia-fbc1-396 libnvidia-fbc1-396:i386 libnvidia-gl-396 libnvidia-gl-396:i386 libnvidia-ifr1-396 libnvidia-ifr1-396:i386
  nvidia-compute-utils-396 nvidia-dkms-396 nvidia-kernel-common-396 nvidia-kernel-source-396 nvidia-prime nvidia-settings nvidia-utils-396 xserver-xorg-video-nvidia-396
The following packages will be REMOVED:
  libnvidia-cfg1-390 libnvidia-compute-390 libnvidia-compute-390:i386 libnvidia-decode-390 libnvidia-decode-390:i386 libnvidia-encode-390 libnvidia-encode-390:i386
  libnvidia-fbc1-390 libnvidia-fbc1-390:i386 libnvidia-gl-390 libnvidia-gl-390:i386 libnvidia-ifr1-390 libnvidia-ifr1-390:i386 xserver-xorg-video-nvidia-390
The following NEW packages will be installed:
  libnvidia-cfg1-396 libnvidia-common-396 libnvidia-compute-396 libnvidia-compute-396:i386 libnvidia-decode-396 libnvidia-decode-396:i386 libnvidia-encode-396
  libnvidia-encode-396:i386 libnvidia-fbc1-396 libnvidia-fbc1-396:i386 libnvidia-gl-396 libnvidia-gl-396:i386 libnvidia-ifr1-396 libnvidia-ifr1-396:i386
  nvidia-compute-utils-396 nvidia-dkms-396 nvidia-driver-396 nvidia-kernel-common-396 nvidia-kernel-source-396 nvidia-prime nvidia-settings nvidia-utils-396
  xserver-xorg-video-nvidia-396
0 upgraded, 23 newly installed, 14 to remove and 62 not upgraded.
Need to get 88,6 MB/88,6 MB of archives.

Leave a Reply

Your email address will not be published.