How to use discrete amd gpu in bottles (or globally)
How to use discrete amd gpu in bottles (or globally)
After about a month of using Nixos, I realized my apps don't use my discrete gpu. I have an intel cpu with integrated graphics and a discrete amd gpu. On windows I had set all apps to use discrete gpu when the laptop was on power. Before I say more, some info for my system:
My main issue is that my bottles apps (bottles is a wine prefix manager) can't run its wine prefixes with a discrete gpu. I have the nixpkgs version of bottles (not the flatpak one which the developer suggests using). Things I've tried:
- Enabling/Disabling the "use discrete graphics" option inside the bottle (only the integrated gpu is being used)
- Launching bottles from command line with
DRI_PRIME=1
and bottles opened for a little and then closed, by reporting this: ::: spoiler terminal output
(process:4413): Gtk-WARNING **: 10:35:38.358: Unknown key gtk-modules in /home/bs/.config/gtk-4.0/settings.ini (process:4413): Adwaita-WARNING **: 10:35:38.384: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported. Please use AdwStyleManager:color-scheme instead. (bottles:4413): Gtk-WARNING **: 10:35:39.395: Theme parser warning: style.css:184:3-185:1: Expected ';' at end of block (bottles:4413): Gtk-WARNING **: 10:35:39.395: Theme parser warning: style-dark.css:23:3-24:1: Expected ';' at end of block 10:35:39 (INFO) Launching with URI: None 10:35:39 (INFO) [Activate] request received. 10:35:39 (WARNING) Bottles is only supported within a sandboxed format. Official sources of Bottles are available at: 10:35:39 (WARNING) https://usebottles.com/download/ 10:35:39 (WARNING) Please report any issues at: https://github.com/NixOS/nixpkgs/issues 10:35:39 (INFO) Bottles Started!
:::
- Launching the game from command line with
DRI_PRIME=1 bottles-cli run -p OuterWilds -b Outer_Wilds
after having enabled/disabled the "use discrete graphics" option inside the bottle (kept using the integrated graphics instead) - Launching the game from bottles gui, after using the enviroment variable
DRI_PRIME=1
and enabling/disabling the "use discrete gpu" option (kept using the integrated graphics instead) - Adding the following code to my configuration.nix:
hardware.graphics = { enable = true; enable32Bit = true; };
- Launching the game from bottles gui, after using the enviroment variable
DRI_PRIME=1 DXVK_FILTER_DEVICE_NAME="AMD Radeon R5 M445 Series (RADV ICELAND)"
and enabling/disabling the "use discrete gpu" option (it told me that I don't have directX11 installed, but the game should run without it according to steamdb) - Setting KDE power profile from "Balanced" to "Performance"
Note that I can launch native apps with discrete gpu by typing in the terminal DRI_PRIME=1 $program_name
, where $program_name
is the name of the program I want to launch (like SuperTuxKart).
Is there a way to launch bottle apps with my discrete gpu or at least run all of my apps with my discrete gpu? Some extra related links I found, but didn't solve my issue:
Cross-posted it at the discourse forum