Ubuntu 19.04 Driver Installed but not Used

Hello - I have a similar issue with Nvidia driver and llvmpipe (LLVM 8.0, 256 bits) and need some help.

andrew@andrew-HP:~$ glxinfo | grep render
direct rendering: Yes
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, GLX_MESA_query_renderer, 
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: llvmpipe (LLVM 8.0, 256 bits)
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, 
    GL_MESA_ycbcr_texture, GL_NV_conditional_render, GL_NV_depth_clamp, 
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, 
    GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_fog_distance, 
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap,
andrew@andrew-HP:~$ nvidia-smi
Wed Oct 23 12:30:40 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26       Driver Version: 430.26       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 MX250       Off  | 00000000:06:00.0 Off |                  N/A |
| N/A   44C    P8    N/A /  N/A |      0MiB /  2002MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Thanks!
nvidia-bug-report.log.gz (1.09 MB)

acrawfor19, your cpu is too new for the running kernel so the intel gpu is not supported. You can enable alpha support for it using kernel parameter
i915.alpha_support=1
but that’s likely unstable. Better upgrade to kernel 5.3.

Upgraded kernel to 5.3.1-050301-generic and the Intel gpu is supported now. Thanks! I just tried installing Ubuntu’s latest drivers and the Nvidia driver refuses to load now (Tried 418,430,435,and 440). Any suggestions would be greatly appreciated.

andrew@andrew-HP:~$ nvidia-smi 
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
andrew@andrew-HP:~$ glxinfo | grep render
direct rendering: Yes
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, GLX_MESA_query_renderer, 
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: Mesa DRI Intel(R) Iris(R) Plus Graphics (Ice Lake 8x8 GT2) 
    GL_ARB_compute_shader, GL_ARB_conditional_render_inverted, 
    GL_NV_conditional_render, GL_NV_depth_clamp, 
    GL_ARB_compute_shader, GL_ARB_conditional_render_inverted, 
    GL_MESA_window_pos, GL_NV_blend_square, GL_NV_conditional_render, 
    GL_EXT_render_snorm, GL_EXT_robustness, GL_EXT_sRGB_write_control, 
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap,
andrew@andrew-HP:~$ sudo lshw -c video
  *-display                 
       description: VGA compatible controller
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       logical name: /dev/fb0
       version: 07
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
       configuration: depth=32 driver=i915 latency=0 mode=1920x1080 visual=truecolor xres=1920 yres=1080
       resources: iomemory:600-5ff iomemory:400-3ff irq:160 memory:6017000000-6017ffffff memory:4000000000-400fffffff ioport:9000(size=64) memory:c0000-dffff
  *-display UNCLAIMED
       description: 3D controller
       product: NVIDIA Corporation
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:06:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: latency=0
       resources: iomemory:600-5ff iomemory:600-5ff memory:55000000-55ffffff memory:6000000000-600fffffff memory:6010000000-6011ffffff ioport:7000(size=128)

nvidia-bug-report.log.gz (80 KB)

Please make sure the needed kernel headers are also installed
sudo apt install --reinstall linux-headers-5.3.1-050301-generic
then check if the nvidia module is installed/post the output of
dkms status

Results of ‘sudo apt install --reinstall linux-headers-5.3.1-050301-generic’

andrew@andrew-HP:~/kernel5_3$ sudo apt install --reinstall linux-headers-5.3.1-050301-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-headers-5.3.1-050301-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-headers-5.3.1-050301-generic' has no installation candidate

I used the following to install the headers again:

sudo dpkg -i linux-headers-5.3.1-050301_5.3.1-050301.201909210632_all.deb

Results:

andrew@andrew-HP:~/kernel5_3$ sudo dpkg -i linux-headers-5.3.1-050301_5.3.1-050301.201909210632_all.deb
(Reading database ... 220343 files and directories currently installed.)
Preparing to unpack linux-headers-5.3.1-050301_5.3.1-050301.201909210632_all.deb ...
Unpacking linux-headers-5.3.1-050301 (5.3.1-050301.201909210632) over (5.3.1-050301.201909210632) ...
Setting up linux-headers-5.3.1-050301 (5.3.1-050301.201909210632) ...

Now I rebooted…

Output of ‘dkms status’:

andrew@andrew-HP:~/kernel5_3$ dkms status
nvidia, 430.26: added

Now I tried ‘nvidia-smi’ again:

andrew@andrew-HP:~/kernel5_3$ nvidia-smi 
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

nvidia-bug-report.log.gz (79.2 KB)

You also need the -generic headers,
linux-headers-5.3.1-050301-generic_5.3.1-050301.201909210632_amd64.deb
Install those, run
sudo dkms install nvidia/430.26 --all
and post the output of
dkms status
afterwards

I’m sorry - I missed the header error in the kernel build:

andrew@andrew-HP:~/kernel5_3$ sudo dpkg -i *.deb
(Reading database ... 220343 files and directories currently installed.)
Preparing to unpack linux-headers-5.3.1-050301_5.3.1-050301.201909210632_all.deb ...
Unpacking linux-headers-5.3.1-050301 (5.3.1-050301.201909210632) over (5.3.1-050301.201909210632) ...
Preparing to unpack linux-image-unsigned-5.3.1-050301-generic_5.3.1-050301.201909210632_amd64.deb ...
/etc/kernel/preinst.d/intel-microcode:
libkmod: ERROR ../libkmod/libkmod-config.c:656 kmod_config_parse: /etc/modprobe.d/iwlwifi.conf line 8: ignoring bad line starting with ''options'
Unpacking linux-image-unsigned-5.3.1-050301-generic (5.3.1-050301.201909210632) over (5.3.1-050301.201909210632) ...
Preparing to unpack linux-modules-5.3.1-050301-generic_5.3.1-050301.201909210632_amd64.deb ...
Unpacking linux-modules-5.3.1-050301-generic (5.3.1-050301.201909210632) over (5.3.1-050301.201909210632) ...
Setting up linux-headers-5.3.1-050301 (5.3.1-050301.201909210632) ...
Setting up linux-modules-5.3.1-050301-generic (5.3.1-050301.201909210632) ...
Setting up linux-image-unsigned-5.3.1-050301-generic (5.3.1-050301.201909210632) ...
Processing triggers for linux-image-unsigned-5.3.1-050301-generic (5.3.1-050301.201909210632) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.3.1-050301-generic
Error! Your kernel headers for kernel 5.3.1-050301-generic cannot be found.
Please install the linux-headers-5.3.1-050301-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.3.1-050301-generic

The dkms install:

andrew@andrew-HP:~/kernel5_3$ sudo dkms install nvidia/430.26 --all

Results:

andrew@andrew-HP:~/kernel5_3$ dkms status
nvidia, 430.26: added

nvidia-bug-report.log.gz (79.3 KB)

Like said, you need to install
linux-headers-5.3.1-050301-generic_5.3.1-050301.201909210632_amd64.deb

The correct ‘generic’ headers install:

andrew@andrew-HP:~/Downloads$ sudo dpkg -i linux-headers-5.3.1-050301-generic_5.3.1-050301.201909210632_amd64.deb

The ‘dkms install’:

sudo dkms install nvidia/430.26 --all
Module nvidia/430.26 already installed on kernel 5.3.1-050301-generic/x86_64

After reboot:

andrew@andrew-HP:~$ nvidia-smi 
Wed Oct 23 18:09:47 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26       Driver Version: 430.26       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 MX250       Off  | 00000000:06:00.0 Off |                  N/A |
| N/A   52C    P0    N/A /  N/A |    173MiB /  2002MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1530      G   /usr/lib/xorg/Xorg                           106MiB |
|    0      1714      G   /usr/bin/gnome-shell                          66MiB |
+-----------------------------------------------------------------------------+

Looks good! Thank you for your patience.

Hello. I have a similar issue and so far none of the solutions have helped.
Would you be able to look?

$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
$ nvidia-smi
Wed Oct 30 01:28:57 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.26       Driver Version: 440.26       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 870M    Off  | 00000000:01:00.0 N/A |                  N/A |
| N/A   54C    P0    N/A /  N/A |      0MiB /  3018MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0                    Not Supported                                       |
+-----------------------------------------------------------------------------+

nvidia-bug-report.log.gz (377 KB)

  • please delete /usr/share/X11/xorg.conf.d/20-glamor.conf
  • remove the kernel parameter nogpumanager
  • install nvidia-prime (sudo apt install nvidia-prime)
  • run: sudo prime-select nvidia
  • reboot

Alas, nothing has changed in how it works and in the glxinfo and nvidia-smi outputs.
However, the output of

xrandr --listproviders

has changed - previously it listed two providers (both named modesetting), now there’s only one. Not sure if it’s relevant at all.
Attached a new report after doing what you asked.

nvidia-bug-report.log.gz (298 KB)

Everything is in place but the gpu-manager doesn’t seem to run. Please run
sudo dpkg-reconfigure ubuntu-drivers-common
sudo systemctl enable gpu-manager
and reboot. Afterwards, attach /var/log/gpu-manager.log

Right. I had to unmask it to make it work.

Aaand I immediately remembered why I have masked it in the first place, and disabled it via the kernel parameter for good measure.
After booting up for the first time, all worked well except that the initial problem was not solved. I looked at /var/log/gpu-manager.log (attached) and noticed that a new Xorg conf file has been created. Just in case I rebooted again - and got a black screen. AFAIK my NVIDIA GPU is not connected to the DP. But I couldn’t make the eDP (the laptop’s own display) work either - xrandr kept telling me about bad parameters or something like that. Also, the names of the outputs changed from something like DP-1 to something like DP-1-1, so all my display management scripts got broken.

In any case, here’s the contents of that new file 11-nvidia-prime.conf that was created by gpu-manager:

# DO NOT EDIT. AUTOMATICALLY GENERATED BY gpu-manager

Section "OutputClass"
    Identifier "Nvidia Prime"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "IgnoreDisplayDevices" "CRT"
    Option "PrimaryGPU" "Yes"
    ModulePath "/x86_64-linux-gnu/nvidia/xorg"
EndSection

A couple of things: I had to prepend “/usr/lib” to the ModulePath since that’s the correct path (“/x86_64-linux-gnu” does not exist at all) and I had to comment out the line setting up PrimaryGPU to make the external screen work. I also renamed 10-nvidia.conf to just 10-nvidia (I think it disables it) since it’s pretty similar to the new file:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection

As you can probably guess, the initial problem still persists.

Just in case - getting the NVIDIA GPU working while being able to use the DisplayPort would be great. But ideally, I want to be able to use the NVIDIA GPU only when I need it, and rely on the Intel GPU for most of the time. NVIDIA GPU would then say disabled during that time since the MSI BIOS makes it impossible to control its fans, and they keep spinning up and down creating a lot of unnecessary noise.
I had this exact setup working with nouveau before these experiments with the proprietary driver - the only thing I had to do to make a program use the NVIDIA GPU was to add DRI_PRIME=1 to its environment variables. The issue with nouveau though is that the performance is just terrible - barely above of the Intel GPU.
gpu-manager.log (1.68 KB)

Ok, that file was missing. Please create a new nvidia-bug-report.log in that state.

Attached, the one where the fixes to the 11-nvidia-prime.conf are applied so I can use the external display.
Let me know if you also need the one with the pristine 11-nvidia-prime.conf, as generated by the gpu-manager.

nvidia-bug-report.log.gz (299 KB)

All nvidia config files are gone in that log. Please create and attach an nvidia-bug-report.log with both 11-nvidia-prime.conf and 10-nvidia.conf in place. Both files are required.

I just checked and /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf is definitely there, along with other conf files.
In any case, I renamed 10-nvidia back to 10-nvidia.conf and restarted Xorg. The new report is attached.
nvidia-bug-report.log.gz (338 KB)

Now you commented out PrimaryGPU in /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf. Please uncomment, try again.