Ubuntu – How to configure an application to always run with DRI_PRIME=1 set? Is there an other way besides terminal

16.04amd-graphicsdrivershybrid-graphicsradeon

I had followed the instructions posted by emk2203 (My AMD Radeon graphic card is not working on 16.04) and now I could make the apps use my secondary AMD card
and it's work! Look:

Firefox running (http://demo.marpi.pl/exp/mecha/) experiment at 15fps

Now, runnig Firefox by Terminal with DRI_PRIME=1:

DRI_PRIME=1 firefox

The same experiment running at 61fps

Thanks emk2203!

Now I need to know how configure the system to always runs the app with the DRI_PRIME=1 set.

Sorry for bad english. I'm brasilian.

Best Answer

  • Here is a little light reading on environment variables for those sleepless nights, but to cut to the chase, I quote:

    "A suitable file for environment variable settings that affect the system as a whole (rather than just a particular user) is /etc/environment.

    This file is specifically meant for system-wide environment variable settings. It is not a script file, but rather consists of assignment expressions, one per line."

    So... Inserting your assignment DRI_PRIME=1 into /etc/environment and then restarting should do what you're asking.

  • Related Question