Force app to use integrated graphics only when using On-Demand profile?

On my Lenovo P50 using the NVIDIA On-Demand profile with the nvidia driver version 465.19.01, I’d like to force firefox to only use the integrated Intel HD 530 graphics.

With this, I hope to be able to use hardware accelerated video decoding via VA-API using the integrated intel graphics as the nvidia driver doesn’t support VA-API and firefox doesn’t support VDPAU.

Is there any way to force the application to not use the nvidia card?

With a classic,most common Optimus setup (igpu is the first device,dgpu is secondary); on demand mode will be doing exactly that by default.

So unless you tell apps to use NV, everything will be on igpu.

http://us.download.nvidia.com/XFree86/Linux-x86_64/460.73.01/README/primerenderoffload.html

I also use such setup with on-demand mode. Other than things i’ve specifially want to run on dgpu by using proper vars from the link i posted; everything is on igpu. Including firefox,mpv etc.

Interesting. It seems like everything is using the dgpu, regardless. Setting the mentioned environment variables do not change anything, neither does the DRI_PRIME variable.

Did I misinterpret the “On-Demand” PRIME Profile in nvidia-settings and does it only manage power profiles instead of using PRIME Render Offload?

Works for me ¯_(ツ)_/¯

On-demand mode

Setup info:

inxi -SMGxx
System:
  Host: asus-FX553VD Kernel: 5.11.16-xanmod1 x86_64 bits: 64 compiler: N/A 
  Desktop: Cinnamon 4.8.6 wm: muffin dm: GDM3, LightDM 
  Distro: Linux Mint 20.1 Ulyssa base: Ubuntu 20.04 focal 
Machine:
  Type: Laptop System: ASUSTeK product: GL553VD v: 1.0 
  serial: <superuser/root required> 
  Mobo: ASUSTeK model: GL553VD v: 1.0 serial: <superuser/root required> 
  UEFI: American Megatrends v: GL553VD.308 date: 04/29/2019 
Graphics:
  Device-1: Intel HD Graphics 630 vendor: ASUSTeK driver: i915 v: kernel 
  bus ID: 00:02.0 chip ID: 8086:591b 
  Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] vendor: ASUSTeK 
  driver: nvidia v: 460.67 bus ID: 01:00.0 chip ID: 10de:1c8d 
  Display: x11 server: X.Org 1.20.9 driver: modesetting,nvidia 
  unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa Intel HD Graphics 630 (KBL GT2) 
  v: 4.6 Mesa 21.0.3 - kisak-mesa PPA direct render: Yes 

It looks good to me too, I think:

System:
  Host: td-primary Kernel: 5.8.0-50-generic x86_64 bits: 64 compiler: N/A 
  Desktop: Cinnamon 4.8.6 wm: muffin dm: LightDM 
  Distro: Linux Mint 20.1 Ulyssa base: Ubuntu 20.04 focal 
Machine:
  Type: Laptop System: LENOVO product: 20EQS3L900 v: ThinkPad P50 
  serial: <superuser/root required> Chassis: type: 10 
  serial: <superuser/root required> 
  Mobo: LENOVO model: 20EQS3L900 serial: <superuser/root required> 
  UEFI: LENOVO v: N1EET85W (1.58 ) date: 06/26/2019 
Graphics:
  Device-1: Intel HD Graphics 530 vendor: Lenovo driver: i915 v: kernel 
  bus ID: 00:02.0 chip ID: 8086:191b 
  Device-2: NVIDIA GM107GLM [Quadro M1000M] vendor: Lenovo driver: nvidia 
  v: 465.19.01 bus ID: 01:00.0 chip ID: 10de:13b1 
  Display: x11 server: X.Org 1.20.9 driver: modesetting,nvidia 
  resolution: 1920x1080~60Hz 
  OpenGL: renderer: NVIDIA Quadro M1000M/PCIe/SSE2 v: 4.6.0 NVIDIA 465.19.01 
  direct render: Yes 

But for example, running glxinfo | grep vendor always shows the nvidia card and I can’t get it to use the igpu:

server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation
OpenGL: renderer: NVIDIA Quadro M1000M/PCIe/SSE2 v: 4.6.0 NVIDIA 465.19.01 
  direct render: Yes 

This should have been Intel one. Are you sure you really switched to on-demand? That output seems like NV only mode.

Thanks a lot for having a look at it! Maybe logging out and back in again wasn’t enough. I deleted my existing xorg.conf and rebooted and now it works :) Thank you again!

1 Like