Ubuntu 18.04 not using Nvidia card

by Anand George   Last Updated September 11, 2019 17:02 PM

I know there exist many questions and answers on the same topic all over the internet, still I couldn't fix the issue on my laptop.

Below are the configurations of my laptop.

  • i5 8th Gen with integrated graphics
  • Nvidia MX250
  • Ubuntu 18.04 (dual booted with Windows 10)

I have installed the recommended driver for the nvidia card - nvidia-driver-435.

Below are some observations:

  • Intel graphic card is displayed in the About section in Settings.
  • NVIDIA X Server settings is not listing the nvidia GPU, but PRIME profiles are available and nvidia is already selected as shown here.
  • lshw -c display shows nvidia card along with the Intel card.
*-display
    description: 3D controller
    product: NVIDIA Corporation
    vendor: NVIDIA Corporation
    physical id: 0
    bus info: [email protected]:02:00.0
    version: a1
    width: 64 bits
    clock: 33MHz
    capabilities: bus_master cap_list
    configuration: driver=nvidia latency=0
    resources: irq:150 memory:93000000-93ffffff memory:80000000-8fffffff memory:90000000-91ffffff ioport:3000(size=128)
  • nvidia-smi gives below output, seems like the nvidia GPU is not in use.
Wed Sep 11 17:57:57 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21       Driver Version: 435.21       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| 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:02:00.0 Off |                  N/A |
| N/A   40C    P8    N/A /  N/A |      0MiB /  2002MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+ 
  • nvidia-detector outputs none

Interestingly, if I run nvidia-smi from a TTY session, can see some processes which use the GPU.

Wed Sep 11 17:54:42 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21       Driver Version: 435.21       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| 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:02:00.0 Off |                  N/A |
| N/A   38C    P8    N/A /  N/A |     12MiB /  2002MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      2564      G   /usr/lib/xorg/Xorg                             7MiB |
|    0      2716      G   /usr/bin/gnome-shell                           4MiB |
+-----------------------------------------------------------------------------+

More observations:

  • If I select Gnome on Xorg or Ubuntu from the login screen, I get a stuck screen and nothing will be working (I usually switch to TTY session and do a restart when this occurs). But Gnome and Ubuntu on Wayland has no problem after login.

Any help is much appreciated.
Cheers!



Answers 1


I don't know about your specific case where some small thing does seem to run on the GPU. However, with problems like these, I found that installing Bumblebee and Primus can help:

sudo apt-get install bumblebee primus

Then, you should be able to run programs with your GPU using optirun program_name or primusrun program_name.

This thread was very helpful for issues I had getting optirun to work: https://bugs.launchpad.net/ubuntu/+source/bumblebee/+bug/1758243 Particularly answer 31:

  1. The first change needed is to edit /etc/bumblebee/bumblebee.conf as follows:

LibraryPath=/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu XorgModulePath=/usr/lib/x86_64-linux-gnu/nvidia-418/xorg,/usr/lib/xorg/modules,/usr/lib/xorg/modules/input XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

This was expected because the path is different for every NVIDIA driver.

  1. The second change needed was to export this:

export __GLVND_DISALLOW_PATCHING=1

And with these two changes everything works.

In your case 418 should presumably be replaced by 435.

kb173
kb173
September 11, 2019 16:43 PM

Related Questions


Updated August 06, 2017 18:02 PM

Updated June 14, 2019 00:02 AM

Updated August 05, 2018 04:02 AM

Updated September 26, 2017 00:02 AM

Updated November 27, 2017 22:02 PM