3

As shown from this blog, Fedora 25 now has NVida graphics binary driver support and users has an option to launch applications with "Launch with Dedicated Graphics Card" with right click on an icon, if your computer has hybrid GPU (Intel/NVidia) configuration.

Given this option, I would like to write scripts to launch my other applications from the command line or to make desktop launchers connected to my scripts directly, with Dedicated Graphics Card option pre-selected.

I am wondering how I can achieve this? or How is this implemented in Fedora 25, so that I can learn from and use it on my scripts? Thank you!

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Yui
  • 33
  • 1
  • 4

1 Answers1

5

As seen in the QA test case, you only need to specify the DRI_PRIME=1 environment variable when launching the application, like so:

[dkarlovi@amelie ~]$ glxgears -info | grep REND
GL_RENDERER   = Mesa DRI Intel(R) Sandybridge Mobile 
^C
[dkarlovi@amelie ~]$ DRI_PRIME=1 glxgears -info | grep REND
GL_RENDERER   = Gallium 0.4 on NVD9
^C
  • It seems it is correct. Though, I do not know how to verify this on other applications. Are there other tools which I can use, to get equivalent information like `-info` of glxgears shows? – Yui Dec 21 '16 at 20:05
  • There are other environment variables to be set, I think I used [LIBGL_DEBUG](http://www.mesa3d.org/envvars.html) before, but it was a long time ago. `LIBGL_DEBUG=verbose DRI_PRIME=1 glxgears`. See [DRI Testing and debugging](https://dri.freedesktop.org/wiki/TestingAndDebugging/). – Dalibor Karlović Dec 22 '16 at 08:27