jump to navigation

Post-it: how to switch to the discrete nvidia card on Ubuntu 18.04 2018-05-03

Posted by claudio in Uncategorized.
Tags: , , , ,
trackback

nvidiaAnother post-it note so I don’t forget (the first one is about how to purge the nvidia drivers and use the open source drivers).

The nvidia drivers are often problematic, and as long the open source drivers have decent performance, that’s OK. On laptops you can always switch to the Intel card with prime, using but in fact bypassing the nvidia drivers.This is also how the open source nouveau driver work.

However, since a few Ubuntu releases the Nvidia drivers seem more buggy, on one one of my system I see this out of the box behaviour:

  • With the open source nouveau drivers the performance on Xorg is terrible (choppy video, OK desktop). Xorg is the default graphical server on Ubuntu 18.04. On 17.10 the default was Wayland.
  • With the open source nouveau drivers the performance on Wayland is good (e.g. for 1080p HEVC video).
  • With the closed source nvidia driver set to use the intel driver the performance on Xorg and Wayland is terrible (choppy video, OK desktop).
  • With the closed source nvidia driver set to use the nvidia you’re stuck in a login manager loop, a black screen or terrible performance on Xorg and Wayland  (choppy video, OK desktop).

If you’re ok with using Wayland (I am on the machine in question, at work my machine has Intel video and I am using Xorg), stick with nouveau and Wayland. Your laptop will get less hot (fans!) and have better battery life. Virtual consoles (ctrl+alt+) will still be available.

If you need Xorg, using the closed source nvidia driver is the only way to get good performance, at least on my machine. If you want to use this driver, follow the instructions below. Be sure to know what you do, you won’t loose files, but you may make your system unbootable (recover with an usb disk) if not done correctly:

– Make sure nvidia is not blacklisted, remove bumblebee if installed. Have a look in /etc/modules and /etc/modprobe.d/*:

$ sudo apt-get remove --purge bumblebee
$ grep nvidia /etc/modules /etc/modprobe.d/*

“blacklist nvidia” is what’s mostly used, remove that.

– Add “nvidia-drm.modeset=1” to the GRUB_CMDLINE line in /etc/default/grub:
$ sudo vi /etc/default/grub
(or use nano instead of vi)

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
becomes
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1"

– Activate the changes:
$ sudo update-grub

– Install Nvidia drivers:
$ sudo ubuntu-drivers autoinstall

– Check if prime has nvidia selected, select nvidia otherwise:
$ prime-select query
$ sudo prime-select nvidia

5. Reboot
$ sudo init 6

Be warned that modeset=1 disables the virtual consoles (ctl+alt+<nr>).

That’s it.

Advertisements

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: