Open bauermann opened 5 years ago
Setting an environment variable outside the snap should already be visible from inside the snap execution environment.
Thank you for your quick response.
I'm sorry that I missed the notification of your reply. Unfortunately I don't have a computer with two graphics cards anymore and I can't test solutions to this issue anymore.
But do I remember that I tried setting the environment variable outside the snap and I verified that it wasn't visible from inside the snap execution environment. I thought I had mentioned that in my issue description, but now I see that it's implied but not explicitly stated.
PRIME allows selecting which of the graphics card present on the system should render a given app.
My laptop has two cards:
By setting the
DRI_PRIME
environment variable to 1, I can tell apps to use my discrete Radeon card, which is much better than the integrated Intel one. Unfortunately, snaps don't inherit the environment and can't see that variable so GOG Galaxy uses the puny Intel card.This bug is to request this to be allowed. I see three options:
Replicate the
DRI_PRIME
variable inside the container, if it's set outside of it at the time the snap is launched. Not sure if snap allows this.Expose a
dri-prime
snap configuration option which I can set to cause theDRI_PRIME
variable to be set with the value in the config option. This is less ideal because it requires manual configuration, but at least allows me to choose the graphics card to be used.gog-galaxy-wine snap sees that there are two graphics cards available (probably using the xrandr command above) and automatically sets
DRI_PRIME
to the non-Intel one, since I don't think anyone would want to play games with their less-powerful card. IMHO this is the best alternative since things automagically work. It could be combined with option 1 and 2 above as a default in caseDRI_PRIME
ordri-prime
haven't been set by the user.