Tuesday, October 25, 2016

Enabling Nvidia Hardware Acceleration in Google Chrome on Ubuntu 16.04

I bought an ASUS GeForce GTX 750 Ti for my Ubuntu 16.04 machine to replace an AMD video card and I noticed right away that Chrome was not operating at peak efficiency. So I checked chrome://gpu and sure enough the hardware acceleration was disabled. What to do?

First, I looked at chrome://settings to make sure hardware acceleration was enabled there. Going to Show advanced settings... --> System showed that the "Use hardware acceleration when available" option was checked. So far so good.

Next, I looked at chrome://flags and enabled the "Override software rendering list" option. I restarted Chrome but when I went back to chrome://gpu hardware acceleration was still disabled.

Doing some research pointed to the fact that the Chrome GPU sandbox was not playing nice with the Nvidia driver, or vice versa. The way to get around this issue was to edit my Unity launcher shortcut found at ~/.local/share/applications/google-chrome.desktop and add the --disable-gpu-sandbox command-line option to the following line:

Exec=/opt/google/chrome/chrome --disable-gpu-sandbox %U

After closing and reopening Chrome, chrome://gpu finally showed that hardware acceleration was enabled on most of the items listed under Graphics Feature Status. The two items that were still disabled were:
  • Rasterization
  • Native GpuMemoryBuffers
Going back to chrome://flags, I enabled the "GPU rasterization" option and restarted Chrome which enabled the Rasterization item. To get the Native GPU Memory Buffers to work, I had to add the --enable-native-gpu-memory-buffers command-line option to the Unity launcher shortcut. Closing and reopening Chrome enabled the Native GpuMemoryBuffers item.

Doing all of this work greatly improved everything Chrome handles including video playback. A neat place to test out the new and improved performance is the WebGL Aquarium page. Select 1000 fish and check the FPS (mine is pegged at 60 fps which is equal to the refresh rate of my monitor).

Note

Getting the right Nvidia proprietary driver to install properly on Ubuntu 16.04 for the GeForce GTX 750 Ti was nothing short of a nightmare. The first thing that I had to do was add the Proprietary GPU Drivers PPA which gives you a lot more options of various Nvidia driver versions than the standard Ubuntu repos do.
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
I tried several different versions of the Nvidia driver and had serious issues with each one I tried. So I went to the Nvidia Download Drivers page and looked up what the appropriate Linux 64-bit driver should be for my card. At the time of this writing, version 367.57 was the one that came up and can be installed with the following command:
sudo apt-get install nvidia-367

No comments:

Post a Comment