Showing posts with label GPU. Show all posts
Showing posts with label GPU. Show all posts

Thursday, December 1, 2016

Well that didn't last long

Unfortunately, using Ubuntu Desktop as my primary OS has come to an end just after six months of "giving it the ol' college try". Why, you might ask? Two words: graphics drivers.

For over sixteen years, I have contributed spare computing power to SETI@Home, and the fastest way to earn credits is to set up GPU computing on BOINC. But in order for GPU computing to work properly on BOINC, it needs to work with an OpenCL library.

  • Open Source Drivers (radeon, nouveau, intel): While the open source drivers for AMD, Nvidia, and Intel all have varying degrees of support for hardware acceleration OOTB, one thing they do not support is OpenCL. While Mesa or Beignet has open source OpenCL support, these libraries do not work with BOINC.
  • AMD Proprietary Drivers: Before Ubuntu 16.04, AMD actually provided the proprietary FGLRX drivers for Linux which actually worked with BOINC after doing some shoehorning to get the drivers and BOINC to play nice together. Since 16.04, however, they have dropped Linux support of all but their most recent graphics chipsets so trying to run GPU computing on BOINC with AMD is nearly impossible unless you have one of their latest cards.
  • Nvidia Proprietary Drivers: After upgrading to Ubuntu 16.04, I went ahead and switched out my AMD R7 250x for an Nvidia GTX 750 Ti since on the surface it appears Nvidia supports Linux better than AMD does. However, trying to find the right driver for the GTX 750 Ti was a nightmare as I posted in Enabling Nvidia Hardware Acceleration in Google Chrome on Ubuntu 16.04. And then once I finally did find the right driver version for my Nvidia card, the very next graphics driver update broke the entire setup completely and my Ubuntu Desktop reverted back to the open source nouveau drivers.
  • Intel Graphics Drivers for Linux: While I had varying degrees of success with getting AMD and Nvidia to churn out GPU credits for BOINC under Ubuntu, for the life of me I could not get my integrated Intel graphics GPU to work with BOINC at all. I tried the open source Linux drivers, I tried Beignet, I tried whatever closed-source libarary they provide for OpenCL. While I could get BOINC to recognize the fact that I at least had an Intel GPU, every time it tried to download work units for the Intel GPU it failed with a computation error.
Unless you have eccentric requirements for GPU usage under Ubuntu like myself, Ubuntu is still a great OS for doing everything else you could possibly want. While Ubuntu Desktop is no longer my primary OS (yes, unfortunately Windows 10 is back), one of the first things I did was to set up a VMWare virtual machine running Ubuntu Desktop 16.04 for my development activities. Even though Microsoft is actively working on the Ubuntu Bash Shell on Windows, it still doesn't compare to running Ubuntu in a VM and doing all of my development efforts therein.

Therefore I am still a committed user of Ubuntu, even though it is now running as a Guest OS in a VM instead of the primary OS on my PC. And I am still a huge fan of Ubuntu Server for running all of my workloads in the cloud. So stay tuned, the Ubuntu Blog lives on.

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