Ubuntu – Nvidia not working on Ubuntu 17.10 on Xorg

17.10nvidianvidia-optimusnvidia-prime

I have a Dell Mobile Precision 5510 with hybrid graphics, both an Intel HD Graphics 530 chip and an Nvidia Quadro M1000M.

I'd like to switch to the Nvidia chip to run some games on SteamOS but can't get it to work.

Dell offers this guide, which is:

sudo apt-get purge libvdpau-va-gl1 bumblebee* nvidia*
sudo apt-get install nvidia-387 nvidia-settings nvidia-prime
sudo reboot

Then

nvidia-settings

or

sudo prime-select nvidia

or

sudo prime-switch nvidia

And a reboot, but none of those work for me.

When I try nvidia-settings:

ERROR: Error querying enabled displays on GPU 0 (Missing Extension).

ERROR: Error querying connected displays on GPU 0 (Missing Extension).

** Message: PRIME: No offloading required. Abort
** Message: PRIME: is it supported? no

ERROR: nvidia-settings could not find the registry key file. This file 
should have been installed along with this driver at
/usr/share/nvidia/nvidia-application-profiles-key-documentation. 
The application profiles will continue to work, but values cannot be
prepopulated or validated, and will not be listed in the help text.
Please see the README for possible values and descriptions.

When I try sudo-prime-switch nvidia:

/etc/modprobe.d is not a file
/etc/modprobe.d is not a file
/etc/modprobe.d is not a file
/etc/modprobe.d is not a file
/etc/modprobe.d is not a file
Error: can't open /lib/modules/4.13.0-16-lowlatency/updates/dkms
Error: can't open /lib/modules/4.13.0-16-lowlatency/updates/dkms
Error: can't open /lib/modules/4.13.0-16-lowlatency/updates/dkms
update-alternatives: error: no alternatives for x86_64-linux-gnu_gfxcore_conf

If I try sudo prime-select nvidia:

Info: the current GL alternatives in use are: ['mesa', 'mesa']
Info: the current EGL alternatives in use are: ['mesa-egl', 'nvidia-387']
Info: selecting nvidia-387 for the nvidia profile
update-alternatives: using /usr/lib/nvidia-387/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-387/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf (x86_64-linux-gnu_egl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-387/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in manual mode

That last one seems promising, if I try sudo prime-select query afterward I get:

nvidia

Great. Except if I reboot, it goes back to Intel, as if nothing happened. Or if I try nvidia-settings afterward, same error.

I already have secure boot completely disabled.

If I open additional drivers by entering software-properties-gtk --open-tab=4 the selected option is set to:

Using NVIDIA binary driver - version 387.22 from nvidia-387 (open source)

Lot of similar questions but none offer a solution beyond what I've tried above.

I'm booting onto Ubuntu Xorg. When I run `nvidia-settings the program runs with the above error message but I don't see any option to switch cards (no "PRIME Profiles" option).

Any ideas?

Best Answer

I'm having the same problem with the nvidia-387 driver. it worked until a system update.

the only way that worked for me is using an older driver: nvidia-384

root@sebapc:/home/sebastian# dpkg -l | grep -i -e nvidia
ii  bbswitch-dkms                              0.8-4ubuntu1                                amd64        Interface for toggling the power on NVIDIA Optimus video cards
ii  cuda-nvtx-9-1                              9.1.85-1                                    amd64        NVIDIA Tools Extension
ii  libcuda1-384                               384.111-0ubuntu1                            amd64        NVIDIA CUDA runtime library
ii  nvidia-384                                 384.111-0ubuntu1                            amd64        NVIDIA binary driver - version 384.111
rc  nvidia-387                                 387.26-0ubuntu1                             amd64        NVIDIA binary driver - version 387.26
ii  nvidia-modprobe                            387.26-0ubuntu1                             amd64        Load the NVIDIA kernel driver and create device files
ii  nvidia-opencl-icd-384                      384.111-0ubuntu1                            amd64        NVIDIA OpenCL ICD
rc  nvidia-opencl-icd-387                      387.26-0ubuntu1                             amd64        NVIDIA OpenCL ICD
ii  nvidia-prime                               0.8.5                                       amd64        Tools to enable NVIDIA's Prime
ii  nvidia-settings                            387.26-0ubuntu1                             amd64        Tool for configuring the NVIDIA graphics driver

The only problem is that this driver is not compatible with CUDA 9.1

* UPDATE *

The problem is (in my case) the kernel.
When installing the driver I get errors during DKMS compilation, The compilation produces a log located in /var/lib/dkms/nvidia-387/387.26/build/make.log.

You can try compile DKMS for the current kernel running

sudo dpkg-reconfigure nvidia-387

and see if you get an error

I solved my problem booting from the old kernel 4.13.0-21-generic instead of latest 4.13.0-25-generic

Here are my system details

GPU:

root@sebapc:/home/sebastian# lspci | grep -i nvidia
01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)

OS version:

root@sebapc:/home/sebastian# uname -a
Linux sebapc 4.13.0-21-generic #24-Ubuntu SMP Mon Dec 18 17:29:16 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux