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:
Fastfetch output
OS: NixOS 25.05 (Warbler) x86_64
Host: Inspiron 5567
Kernel: Linux 6.12.12
DE: KDE Plasma
WM: KWin (Wayland)
WM Theme: Breeze
Theme: Breeze (Dark) [Qt]
Icons: breeze-dark [Qt], breeze-dark [GTK2/3/4]
Font: Noto Sans (10pt) [Qt], Noto Sans (10pt) [GTK2/3/4]
Cursor: breeze (24px)
Terminal: konsole 24.12.1
CPU: Intel® Core™ i5-7200U (4) @ 3.10 GHz
GPU 1: AMD Radeon R5 M445 Series [Discrete]
GPU 2: Intel HD Graphics 620 @ 1.00 GHz [Integrated]
Memory: 3.23 GiB / 23.37 GiB (14%)
Swap: Disabled
Disk (/): 88.15 GiB / 195.85 GiB (45%) - ext4
Disk (/home): 514.67 GiB / 716.87 GiB (72%) - ext4
Locale: en_US.UTF-8
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:
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 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:
links
- https://github.com/bottlesdevs/Bottles/issues/2000
- https://github.com/bottlesdevs/Bottles/issues/2967
- https://github.com/bottlesdevs/Bottles/issues/940
- https://search.nixos.org/packages?channel=unstable&show=mesa-demos&from=0&size=50&sort=relevance&type=packages&query=glxinfo
- https://old.reddit.com/r/linux_gaming/comments/uibl1g/how_to_force_a_game_to_use_gpu/
- https://askubuntu.com/questions/791022/how-to-configure-an-application-to-always-run-with-dri-prime-1-set-is-there-an
- https://community.frame.work/t/bottles-wine-how-to-force-dgpu/58879
- https://wiki.nixos.org/wiki/AMD_GPU
- https://community.frame.work/t/solved-dri-prime-1-for-a-steam-game-without-function/55421/12
- https://wiki.archlinux.org/title/PRIME
- https://old.reddit.com/r/linux_gaming/comments/i9079s/question_about_dri_prime1/
- https://discourse.nixos.org/t/24-11-amd-gpu-how-to-use-mesa-radv-instead-of-amdvlk/57110
Cross-posted it at the discourse forum
Have the same issue due to my vfio setup https://github.com/bottlesdevs/Bottles/issues/3270 No activity since my comment. My setup has an Intel CPU with integrated graphics, an AMD GPU for the host, and an Nvidia GPU for my vfio setup with no drivers loaded. Bottles just won’t use the amd card so I can’t really use it for any apps that need a GPU. I guess it just has some really weak logic for deciding which one it should pick.
Hopefully they just give us an option to let us choose which device it should use. Maybe we could convince them to do it with the cosmic rewrite they’ve talked about.
Does your discrete gpu run any other apps? I figured out that my discrete gpu seems to only run SuperTuxKart (not even firefox-beta or Kate). It seems very incompatible or something
Yeah, I can use it normally for games. Bottles just seems to not want to. My issue may be slightly different then.