Disabling NVIDIA rendering/usage for certain applications

OS: Ubuntu 16.04
NVIDIA Driver Version: 410.48
CUDA: 9.0

Hey!

Just wondering how to disable dedicated GPU usage for certain applications under linux. I’m using tensorflow for deeplearning, and with every batch of data sent to the GPU, firefox stutters, this does not however happen with most other applications, not even with the windowing system.

My CPU has integrated graphics, UEFI is configured to use the integrated graphics for display, the display is also connected to the motherboard’s HDMI output. Therefore, my NVidia card is solely a plugin card.

However, Firefox appears to be using the NVidia card for some kind of hardware accelerated rendering, and even toggling off the hardware acceleration option at Firefox’s settings does not seem to fix the issue.

I’ve also pocked around at nvidia’s xserver configuration manager at the applications profiles tab, i do not however know what the key to set a certain process to use the integrated graphics, instead of the dedicated, one is.

There appears to be a brief description as to what these profile keys could be, in the link down below:
https://us.download.nvidia.com/XFree86/Linux-x86/319.32/README/profiles.html

However, again, i have no idea how any of that’s supposed to set an application to not use the dedicated graphics but instead the integrated one.

I’d be greatly thankful for any help!

It’s Ubuntu specific, especially 16.04. Ubuntu configured your system for hybrid graphics, meaning rendering is done on the nvidia and the intel gpu is only used to drive the display. You should be able to switch to iGPU using
sudo prime-select intel
but then you won’t be able to use cuda anymore due to the way Ubuntu 16.04 switches the libs.
One possibility is to purge anything nvidia except for cuda, then download the .run installer from nvidia’s site and carefully! run
sh ./.run --dkms --no-opengl-files

Maybe you will also have to create an xorg.conf for your iGPU and use the kernel parameter nogpumanager

Afterwards, you will be able to use the nvidia gpu for cuda only and all graphics will use the igpu only.