6

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.

3 Answers3

5

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.

bashBedlam
  • 1,072
  • 1
  • 8
  • 16
2

There is now a PrefersNonDefaultGPU .desktop file key. It was merged into the spec on 2020-04-27 and GNOME has just received the first implementation 3 hours ago and you may be able to use it after gnome-shell version 3.37.1.

int_ua
  • 8,892
1

You can set an environment variable system-wide by setting it in /etc/default/locale. This will set it for all users, so you want to be sure that's what you really want. Keep in mind that local settings (such as in .bashrc) will override the system-wide setting.