Bottles icon indicating copy to clipboard operation
Bottles copied to clipboard

[Bug]: Bottles doesn't use the discrete gpu.

Open Tungsten842 opened this issue 2 years ago • 21 comments

Describe the bug

The discrete gpu option doesn't work, games run with the integrated gpu instead of my amd gpu. Radeontop shows 0% gpu utilization.

To Reproduce

  1. Open bottles
  2. Run something
  3. The game runs with the integrated gpu.

Package

Flatpak from Flathub

Distribution

Nixos 22.11pre403473.b784c5ae63d

Troubleshooting Logs

Version: 2022.8.28-brescia-1
Display:
    X.org: true
    X.org (port): :99.0
    Wayland: true
Graphics:
    vendors:
        intel:
            vendor: intel
            envs:
                DRI_PRIME: '1'
            icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/intel_icd.x86_64.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/intel_icd.i686.json
    prime:
        integrated: null
        discrete: null
Kernel:
    Type: Linux
    Version: 5.15.60-xanmod1
Distro:
    Name: GNOME
    Version: '"42 (Flatpak runtime)"'
Disk:
    Total: 4126724096
    Free: 4126580736
RAM:
    MemTotal: 7.7GiB
    MemAvailable: 4.4GiB
Bottles_envs: null
2

Display Protocol

Wayland

Display Backend used by Bottles

Wayland

Additional context

No response

Tungsten842 avatar Aug 29 '22 13:08 Tungsten842

This is because Bottles found only 1 GPU (Intel). How many gpu do you have?

mirkobrombin avatar Aug 29 '22 17:08 mirkobrombin

This is because Bottles found only 1 GPU (Intel). How many gpu do you have?

I have a laptop with intel graphics and an amd gpu. 00:02.0 VGA compatible controller: Intel Corporation HD Graphics 5500 (rev 09) 09:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Topaz XT [Radeon R7 M260/M265 / M340/M360 / M440/M445 / 530/535 / 620/625 Mobile]

Tungsten842 avatar Aug 29 '22 17:08 Tungsten842

Does it works setting the DRI_PRIME=1 env var and disabling the discrete gpu option?

mirkobrombin avatar Aug 29 '22 17:08 mirkobrombin

Does it works setting the DRI_PRIME=1 env var and disabling the discrete gpu option?

No, it does not.

Tungsten842 avatar Aug 29 '22 17:08 Tungsten842

I think this is not a optimus laptop

mirkobrombin avatar Aug 29 '22 17:08 mirkobrombin

I think this is not a optimus laptop

It isn't, but DRI_PRIME=1 works without any problem on my laptop with steam, lutris and basically every application on my system.

Tungsten842 avatar Aug 29 '22 17:08 Tungsten842

I've taken a look at how we manage gpus in bottles and DRI_PRIME is overwritten according to your gpu, so as the amd one is not listed, it forces intel. Did you set DRI_PRIME from the bottle environment variables section?

mirkobrombin avatar Aug 29 '22 17:08 mirkobrombin

Yes image

Tungsten842 avatar Aug 29 '22 17:08 Tungsten842

Please post the output of lspci | grep 'VGA'

mirkobrombin avatar Aug 29 '22 18:08 mirkobrombin

Please post the output of lspci | grep 'VGA'

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 5500 (rev 09)

Tungsten842 avatar Aug 29 '22 18:08 Tungsten842

So the problem is not with Bottles, it doesn't recive your AMD card at all. I think this is more a Flatpak problem then Bottles.

mirkobrombin avatar Aug 31 '22 12:08 mirkobrombin

So the problem is not with Bottles, it doesn't recive your AMD card at all. I think this is more a Flatpak problem then Bottles.

Well, GPUViewer from flatpak, sees the amd gpu without any issue. Simply running flatpak run io.github.arunsivaramanneo.GPUViewer image

Tungsten842 avatar Aug 31 '22 19:08 Tungsten842

So the problem is not with Bottles, it doesn't recive your AMD card at all. I think this is more a Flatpak problem then Bottles.

I have just installed lutris from flatpak and I can confirm that the amd gpu works without any problem there, so this is definitely related to bottles.

Tungsten842 avatar Sep 06 '22 21:09 Tungsten842

Maybe lutris performs some other checks. Idk how it does its stuffs

mirkobrombin avatar Sep 09 '22 10:09 mirkobrombin

@mirkobrombin should we ping Lutris devs for this?

TheEvilSkeleton avatar Oct 12 '22 21:10 TheEvilSkeleton

I don't want to ping them for this, the code is public, I'll take a look

mirkobrombin avatar Oct 13 '22 05:10 mirkobrombin

Hey - I also have this issue, with a AMD Radeon RX640 and an Intel CPU.

Here's the troubleshooting information from Bottles:

Version: 2022.9.28.1
Display:
    X.org: true
    X.org (port): :99.0
    Wayland: false
Graphics:
    vendors:
        intel:
            vendor: intel
            envs:
                DRI_PRIME: '1'
            icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/intel_icd.x86_64.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/intel_icd.i686.json
    prime:
        integrated: null
        discrete: null
Kernel:
    Type: Linux
    Version: 5.13.0-30-generic
Distro:
    Name: GNOME
    Version: '43'
Disk:
    Total: 8222072832
    Free: 8221929472
RAM:
    MemTotal: "16.4\_GB"
    MemAvailable: "9.1\_GB"
Bottles_envs: null

lspci | grep VGA has a similar output as shown above.

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics (rev 02)

codemicro avatar Oct 22 '22 17:10 codemicro

Can you all try reproducing this again? Also, do tell where you're running lspci from - if I understand everything correctly, the dedicated GPUs here seem to just.... Not exist.

orowith2os avatar Aug 02 '23 18:08 orowith2os

My 2 cents...this is not an issue if Bottles is lauched using the discrete GPU. (right click, then Launch using Discrete GPU) Unfortunately, only GNOME provides that level of control. KDE AFAIK doesn't have that.

ADBeveridge avatar Oct 14 '23 03:10 ADBeveridge

One thing I think needs to be pointed out is that both DXVK and VKD3D, both mainline and Proton, have had new environmental control variables added. If the control variable is correctly specified, either iGPU or dGPU is used. If this is not specified, it seems that DXVK and VKD3D will always attempt to use the dGPU if available.

Old info around the internet suggests adding DRI_PRIME=1 to force dGPU on Steam games and such on systems that don't use nVidia Optimus. However, with Proton 8.0 and Experimental, this is no longer necessary, but if I use DRI_PRIME=0 to force iGPU, this gets ignored.

I have a bottle with Ubisoft Connect and Avatar: Frontiers of Pandora installed and it would not use my dGPU with "Use Discreet Graphics" enabled or DRI_PRIME=1. I checked the VKD3D Github page to see if anything had changed there and noticed this new-ish environmental setting that it tests for: VKD3D_VULKAN_DEVICE. I added VKD3D_VULKAN_DEVICE=1 to my the bottle's environmental variables list and viola, the dGPU is now working.

DXVK has a similar environmental setting DXVK_FILTER_DEVICE_NAME="Device Name".

TLDR:

Add VKD3D_VULKAN_DEVICE=1 to bottle's environmental variables for DX12 games and DXVK_FILTER_DEVICE_NAME="Device Name" for DX9 - DX11 games, though you'll need to replace "Device Name" with the dGPU device name which can be acquired with vulkaninfo | grep 'deviceName'.

nfinite-recursion avatar Jan 26 '24 00:01 nfinite-recursion