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 $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:

links

Cross-posted it at the discourse forum

  • heehaw@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    3 days ago

    I had similar issue while using lutris. I changed hardware.graphics setting until it worked. Now it looks something like this

    hardware.graphics = {
        enable = true;
        enable32Bit = true;
        extraPackages = with pkgs; [
          amdvlk
    		  vulkan-loader
          vulkan-tools
          libvdpau
          libva
        ];
    };
    

    I don’t know exactly what worked, but you can give it a try.

    • Blastboom StriceOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      3 days ago

      Heyo, thanks for answering!

      May I ask, what is that for? Does it allow you to run apps with DRI_PRIME=1 from command line?

      (So far, I think my gpu might only be able to run supertuxkart with thr discrete gpu using the DRI_PRIME=1 command prefix.)

      Edit: I tried it and I still can’t launch kate, firefox-beta etc. with my gpu. Only supertuxkart somehow seems to be working (and the vkcube test). Thanks for trying to help!