Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan/DXVK games in Flatpak on Nvidia GPU won't launch #327

Open
YanEx13 opened this issue Jan 17, 2025 · 7 comments
Open

Vulkan/DXVK games in Flatpak on Nvidia GPU won't launch #327

YanEx13 opened this issue Jan 17, 2025 · 7 comments

Comments

@YanEx13
Copy link

YanEx13 commented Jan 17, 2025

Hello everyone, I'm reaching out here because I have no idea where else to ask for help. I'm experiencing an issue with running games that use Vulkan (DXVK) in Flatpak—they simply won't launch. This affects applications like Steam, Bottles, and Heroic in Flatpak. Initially, I encountered this problem on Fedora 40 and couldn't find a solution. I decided to try CachyOS, but within just a couple of hours, the same issue appeared there as well.

I have a laptop with hybrid graphics, and the problem doesn’t occur when using an external monitor or when switching to an X11 session instead of Wayland. Games that use OpenGL also run without any issues.

Below, I've included links to my bug reports. Any help would be greatly appreciated!

flatpak/flatpak#5802
NVIDIA/open-gpu-kernel-modules#698

Here are screenshots of the errors that appear after launching the games:

Image
Image

Operating System: CachyOS Linux 
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.12.9-3-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 12 × 11th Gen Intel® Core™ i5-11400H @ 2.70GHz
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics
Manufacturer: HP
Product Name: Victus by HP Laptop
@guihkx
Copy link
Collaborator

guihkx commented Jan 17, 2025

Does this only affect Flatpak apps? E.g. do you have this problem if you install Steam/Bottles/Heroic through your distro's package manager?

The problem also seems tricky to reproduce consistently, judging by how you've described it here:

I decided to try CachyOS, but within just a couple of hours, the same issue appeared there as well.

In any case, can you try running vulkaninfo and glxinfo inside Flatpak'd Steam just so we can at least check that the discrete GPU is being used?

Here are command line instructions for that (please post the output of the last command only):

Testing Vulkan (x86_64 / x86)

# RPM source: https://kojihub.stream.centos.org/koji/buildinfo?buildID=46408
curl -LO https://kojihub.stream.centos.org/kojifiles/packages/vulkan-tools/1.3.268.0/1.el9/x86_64/vulkan-tools-1.3.268.0-1.el9.x86_64.rpm
# Extract vulkaninfo from the rpm file
bsdtar -xf vulkan-tools-1.3.268.0-1.el9.x86_64.rpm --strip-components 3 --include usr/bin/vulkaninfo -O > vulkaninfo64
# Give it execute permission
chmod +x vulkaninfo64
# Run vulkaninfo within Flatpak'd Steam, and make sure that the output matches your GPU name/model, and not llvmpipe or something else
flatpak run --command=$PWD/vulkaninfo64 --filesystem=$PWD:ro com.valvesoftware.Steam --summary | grep -wm1 deviceName
# RPM source: https://kojihub.stream.centos.org/koji/buildinfo?buildID=46408
curl -LO https://kojihub.stream.centos.org/kojifiles/packages/vulkan-tools/1.3.268.0/1.el9/i686/vulkan-tools-1.3.268.0-1.el9.i686.rpm
# Extract vulkaninfo from the rpm file
bsdtar -xf vulkan-tools-1.3.268.0-1.el9.i686.rpm --strip-components 3 --include usr/bin/vulkaninfo -O > vulkaninfo32
# Give it execute permission
chmod +x vulkaninfo32
# Run vulkaninfo within Flatpak'd Steam, and make sure that the output matches your GPU name/model, and not llvmpipe or something else
flatpak run --command=$PWD/vulkaninfo32 --filesystem=$PWD:ro com.valvesoftware.Steam --summary | grep -wm1 deviceName

Testing OpenGL (x86_64 / x86)

# RPM source: https://kojihub.stream.centos.org/koji/buildinfo?buildID=19862
curl -LO https://kojihub.stream.centos.org/kojifiles/packages/mesa-demos/8.4.0/5.20181118git1830dcb.el8/x86_64/glx-utils-8.4.0-5.20181118git1830dcb.el8.x86_64.rpm
# Extract glxinfo from the rpm file
bsdtar -xf glx-utils-8.4.0-5.20181118git1830dcb.el8.x86_64.rpm --strip-components 3 --include usr/bin/glxinfo -O > glxinfo64
# Give it execute permission
chmod +x glxinfo64
# Run glxinfo within Flatpak'd Steam, and make sure that the output does not say 'llvmpipe'
flatpak run --command=$PWD/glxinfo64 --filesystem=$PWD:ro com.valvesoftware.Steam -B | grep 'OpenGL renderer string:'
# RPM source: https://kojihub.stream.centos.org/koji/buildinfo?buildID=19862
curl -LO https://kojihub.stream.centos.org/kojifiles/packages/mesa-demos/8.4.0/5.20181118git1830dcb.el8/i686/glx-utils-8.4.0-5.20181118git1830dcb.el8.i686.rpm
# Extract glxinfo from the rpm file
bsdtar -xf glx-utils-8.4.0-5.20181118git1830dcb.el8.i686.rpm  --strip-components 3 --include usr/bin/glxinfo -O > glxinfo32
# Give it execute permission
chmod +x glxinfo32
# Run glxinfo within Flatpak'd Steam, and make sure that the output does not say 'llvmpipe'
flatpak run --command=$PWD/glxinfo32 --filesystem=$PWD:ro com.valvesoftware.Steam -B | grep 'OpenGL renderer string:'

@YanEx13
Copy link
Author

YanEx13 commented Jan 17, 2025

Does this only affect Flatpak apps? E.g. do you have this problem if you install Steam/Bottles/Heroic through your distro's package manager?

Yes, this issue is specific to Flatpak. It doesn't occur with the native versions of Steam or Heroic Games Launcher.

Here are command line instructions for that (please post the output of the last command only):

Vulkan

ERROR while creating surface for extension VK_KHR_xcb_surface : /builddir/build/BUILD/Vulkan-Tools-vulkan-sdk-1.3.268.0/vulkaninfo/vulkaninfo.h:237:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_UNKNOWN
ERROR while creating surface for extension VK_KHR_xcb_surface : /builddir/build/BUILD/Vulkan-Tools-vulkan-sdk-1.3.268.0/vulkaninfo/vulkaninfo.h:237:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_UNKNOWN
ERROR while creating surface for extension VK_KHR_xlib_surface : /builddir/build/BUILD/Vulkan-Tools-vulkan-sdk-1.3.268.0/vulkaninfo/vulkaninfo.h:237:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_UNKNOWN
ERROR while creating surface for extension VK_KHR_xlib_surface : /builddir/build/BUILD/Vulkan-Tools-vulkan-sdk-1.3.268.0/vulkaninfo/vulkaninfo.h:237:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_UNKNOWN
ERROR while creating surface for extension VK_KHR_wayland_surface : /builddir/build/BUILD/Vulkan-Tools-vulkan-sdk-1.3.268.0/vulkaninfo/vulkaninfo.h:237:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_UNKNOWN
ERROR while creating surface for extension VK_KHR_wayland_surface : /builddir/build/BUILD/Vulkan-Tools-vulkan-sdk-1.3.268.0/vulkaninfo/vulkaninfo.h:237:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_UNKNOWN
        deviceName         = Intel(R) UHD Graphics (TGL GT1)

OpenGL

OpenGL renderer string: Mesa Intel(R) UHD Graphics (TGL GT1)

If I run vulkaninfo in the terminal beforehand, the errors disappear.
ERROR while creating surface for extension VK_KHR_xcb_surface : /builddir/build/BUILD/Vulkan-Tools-vulkan-sdk-1.3.268.0/vulkaninfo/vulkaninfo.h:237:vkGetPhysicalDeviceSurfacePresentModesKHR failed with ERROR_UNKNOWN

@guihkx
Copy link
Collaborator

guihkx commented Jan 17, 2025

Judging by both outputs, your NVIDIA GPU is not being used at all...?

Unfortunately, I don't have a laptop with hybrid graphics to debug this, and I also have no idea how they're supposed to work in general, but I at least expected that the discrete GPU would be used unconditionally when running any 3D app...

If I run vulkaninfo in the terminal beforehand, the errors disappear.

But does it still say Intel(R) UHD Graphics (TGL GT1) on the Flatpak side after you run vulkaninfo/glxinfo on the host?

What output do you get if you run vulkaninfo --summary | grep -wm1 deviceName and glxinfo -B | grep 'OpenGL renderer string:' directly on the host instead?

Also, please post the output for each of these commands:

$ cat /sys/module/nvidia/version
$ flatpak --gl-drivers
$ flatpak info "org.freedesktop.Platform.GL.nvidia-$(cat /sys/module/nvidia/version | tr '.' '-')"
$ flatpak info "org.freedesktop.Platform.GL32.nvidia-$(cat /sys/module/nvidia/version | tr '.' '-')"

@YanEx13
Copy link
Author

YanEx13 commented Jan 17, 2025

Judging by both outputs, your NVIDIA GPU is not being used at all...?

It seems so, but I can’t say for sure. However, if you run vulkaninfo on the host while Steam is open and then try to launch the game again, it will start. The game runs on the Nvidia GPU, as indicated by Mangohud.

But does it still say Intel(R) UHD Graphics (TGL GT1) on the Flatpak side after you run vulkaninfo/glxinfo on the host?

Yes, that's right.

vulkaninfo --summary | grep -wm1 deviceName

deviceName = NVIDIA GeForce RTX 3060 Laptop GPU

glxinfo -B | grep 'OpenGL renderer string:'

OpenGL renderer string: Mesa Intel(R) UHD Graphics (TGL GT1)

cat /sys/module/nvidia/version

565.77

flatpak --gl-drivers

nvidia-565-77
default
host

flatpak info "org.freedesktop.Platform.GL.nvidia-$(cat /sys/module/nvidia/version | tr '.' '-')"

ID: org.freedesktop.Platform.GL.nvidia-565-77
Ref: runtime/org.freedesktop.Platform.GL.nvidia-565-77/x86_64/1.4
Arch: x86_64
Branch: 1.4
Origin: flathub
Collection: org.flathub.Stable
Installation: system
Installed: 2.4 MB

  Commit: 290b1940b49929cfe9995e1a26145d6f04e6252fc9b59585ccb77e8528f0cb28
  Parent: 89b5c61dd817fd014345ad95ec873606f346a3aff2bdd62d57f65346f5565344
 Subject: Add 535.230.02 (ece22284)
    Date: 2025-01-17 20:26:40 +0000

flatpak info "org.freedesktop.Platform.GL32.nvidia-$(cat /sys/module/nvidia/version | tr '.' '-')"

ID: org.freedesktop.Platform.GL32.nvidia-565-77
Ref: runtime/org.freedesktop.Platform.GL32.nvidia-565-77/x86_64/1.4
Arch: x86_64
Branch: 1.4
Origin: flathub
Collection: org.flathub.Stable
Installation: system
Installed: 2.4 MB

  Commit: 1f8b8871ecf8e0d6095940374e8971b2d7aff3b7d99b8813af5e763bb2ee33d1
  Parent: e9bed019759da66d78bfa46f8453772dcc483dfd8f469a745cfa3fd7fa93fb9d
 Subject: Add 535.230.02 (ece22284)
    Date: 2025-01-17 20:21:23 +0000

@guihkx
Copy link
Collaborator

guihkx commented Jan 17, 2025

Thank you for providing those.

I still have no idea why that happens, but let's hope that someone who knows what's going on chimes in.

@sequencerr

This comment has been minimized.

@YanEx13
Copy link
Author

YanEx13 commented Jan 26, 2025

Last update broke launching games for me too, ValveSoftware/steam-for-linux#11697 (comment)

If you have an Nvidia graphics card, try running the following command in the terminal:

sudo systemctl status nvidia-persistenced

If the service is disabled, enable it with:

sudo systemctl enable nvidia-persistenced --now

It seems like this helped me, but I’d like to run a few more tests on other desktop environments.
For some reason, it was disabled on KDE after I installed the drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants