Successful ubuntu 18.04 with iGPU for xserver and nvidia GPU for CUDA work setup

Hi, I also have a working setup, which seems to differ from the methods shown here, so for completeness here it is (just posted this as an answer in another thread, then thought this might be worth a topic on its own, just to find it existed already;-) .This uses no runfiles or compiliation but works with everything “out of the box” / apt packages etc. so maybe easier for linux-inexperienced folks.


  • (Install Ubuntu 18.04)

  • Install nvidia driver, reboot.

  • in a terminal use nvidia-smi to check the gpu is recognized correctly, note the memory consumption of up to 400MB just for the xserver GUI.

  • in the xserver desktop go to nvidia-settings-gui and change the PRIME Profile to “Intel (Power Saving Mode)”

  • reboot!

  • in a terminal use nvidia-smi, it should not find a gpu (unless you have multiple…) and give some error message

  • then edit /etc/modprobe.d/blacklist-nvidia.conf and delete or comment the following lines out:

    # blacklist nvidia
    blacklist nvidia-drm
    # blacklist nvidia-modeset
    # alias nvidia off
    alias nvidia-drm off
    # alias nvidia-modeset off
    
  • edit/create/add the following to /etc/modprobe.d/blacklist-nvidia-nouveau.conf:

    blacklist nouveau
    options nouveau modeset=0

  • (this step should have been done when first installing the gpu drivers or the disabling of the nouveau drivers was done in some different way, but add this just to be sure)

  • reboot

  • in a terminal use nvidia-smi, GPU should again be recognized and there should now be NO processes using the GPU and available memory should be the max of the card. At the same time the gui should be running (now powered by the internal Intel Graphics Chip). Yeah! :wink: :+1:

  • Note: On some desktops you might have to use a different monitor output (the one from the main board, not the one from the graphics card). On some it still somehow gets routed through…

This of course was not “invented” by me but is a summary of numerous SO articles I had to go through to get this working.
Currently works with the supported nvidia-390 (via apt install) driver, have not tested with 396 or higher yet.

7 Likes