Dota-2-Vulkan icon indicating copy to clipboard operation
Dota-2-Vulkan copied to clipboard

SDL_VIDEODRIVER=wayland not working with -vulkan

Open konstantinblaesi opened this issue 6 years ago • 35 comments

Your system information

  • System information from steam https://gist.github.com/konstantinblaesi/19b4a47c937af69265902f6ab41df7fc
  • Information missing from steam system information: dGPU Radeon RX 480
  • Have you checked for system updates?: Yes
  • Are you using the latest stable video driver available for your system? Yes
  • Have you verified the game files?: Yes

Please describe your issue in as much detail as possible:

Environment:

  • Fedora 29
  • Gnome 3 on wayland
  • Games run on the dGPU using DRI_PRIME=1
  • Dota 2 on wayland using start options LD_PRELOAD=/lib64/libSDL2-2.0.so.0 SDL_VIDEODRIVER=wayland DRI_PRIME=1 %command%

Steps for reproducing this issue:

  1. add -vulkan to start options
  2. game doesn't start, error message:

the selected graphics queue does not support presenting a swapchain image

When setting SDL_VIDEODRIVER=x11 instead of SDL_VIDEODRIVER=wayland the game starts.

konstantinblaesi avatar Nov 02 '18 12:11 konstantinblaesi

Updates? Is it an issue with the Gnome/Linux stack or Dota 2 itself?

konstantinblaesi avatar Mar 08 '19 15:03 konstantinblaesi

SDL_VIDEODRIVER=wayland steam and I get:

Error LoadSystemAndDependencies(): AppSystemDict: Error in Init() of interface 'RenderDeviceMgr001'!

When trying to run dota2.

romulasry avatar Mar 27 '19 03:03 romulasry

Updates? Is it an issue with the Gnome/Linux stack or Dota 2 itself?

Dota2.

Someone on gamingonlinux.com said it might have been something to do with the old sdl library the game ships with. They all need updated to support wayland.

romulasry avatar Mar 27 '19 03:03 romulasry

@romulasry I am running dota 2 on fedora 29 with gnome/wayland and I use the system provided SDL library, see #282

konstantinblaesi avatar Mar 27 '19 14:03 konstantinblaesi

@romulasry I am running dota 2 on fedora 29 with gnome/wayland and I use the system provided SDL library, see #282 Well, that works, but not in combination with vulkan for me.

Possible setup

  • using X11 + OpenGl
  • using X11 + Vulkan
  • using wayland + OpenGL

Game crashes

  • using wayland + Vulkan

Any updates on the issue?

cRaZy-bisCuiT avatar Apr 06 '19 14:04 cRaZy-bisCuiT

Can confirm that this is still an issue. Unsure if it's a SDL2 bug or Dota 2 bug

simvux avatar Nov 01 '19 14:11 simvux

Update?

romulasry avatar Jan 03 '20 05:01 romulasry

EDIT: Seems I was wrong... it was supposed to run with Wayland but it was using Xwayland. :'/

I tried on Arch with the latest available kernel + mesa stack there and Intel and it was working with vulkan + wayland - at least it was starting. Can I somehow check if xwayland or wayland was in use and if vulkan worked?

With AMD (RX 480 8 GB) it failed.

cRaZy-bisCuiT avatar Jan 20 '20 08:01 cRaZy-bisCuiT

Any update on that ropic? Maybe @rcgordon could have a look please? :)

cRaZy-bisCuiT avatar Jun 22 '20 07:06 cRaZy-bisCuiT

This issue still persists. When using a Ubuntu 20.04 wayland session, I can not start the game with -vulkan at all. Neither LD_PRELOAD=/lib64/libSDL2-2.0.so.0 SDL_VIDEODRIVER=wayland -vulkan nor SDL_VIDEODRIVER=x11 -vulkan seem to work. The PC completely freezes, so I have to reboot. Hardware: Ryzen 7 4700U with integrated Vega graphics. No dedicated GPU.

In a X11 session, i can use -vulkan without issues. (But X11 does have other bugs, e.g. super tiny steam launcher when using fractional scaling 125%)

I have installed:

sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt install libvulkan1 mesa-vulkan-drivers vulkan-utils

and the latest kernel: 5.8.12 I also changed a line in Grub to: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash iommu=pt"

Kuphi avatar Sep 29 '20 09:09 Kuphi

LD_PRELOAD=/lib64/libSDL2-2.0.so.0 SDL_VIDEODRIVER=wayland %command% -vulkan 2020-09-29 20-30-38

sinaflan avatar Sep 29 '20 11:09 sinaflan

LD_PRELOAD=/lib64/libSDL2-2.0.so.0 SDL_VIDEODRIVER=wayland %command% -vulkan 2020-09-29 20-30-38

Any details about your setup?

Kuphi avatar Sep 29 '20 11:09 Kuphi

LD_PRELOAD=/lib64/libSDL2-2.0.so.0 SDL_VIDEODRIVER=wayland %command% -vulkan 2020-09-29 20-30-38

Any details about your setup?

Radeon RX 590 Series (POLARIS10, DRM 3.38.0, 5.8.10-un-def-alt1, LLVM 10.0.1)

sinaflan avatar Sep 29 '20 11:09 sinaflan

Same as @Kuphi on an RX580 - however I cannot get it to work with Wayland and -gl either; in that case I get:

InitializeDisplayDB():
Unable to create dummy window for GLMDisplayDB.

Any suggestions for that?

geez0x1 avatar Nov 03 '20 20:11 geez0x1

Any development on this? I tested with a newer version of SDL2 (SDL2-2.0.so.0.14.0) and it didn't work. Also tested with AMDVLK and the proprietary AMDGPU-PRO vulkan driver. I can run it with OpenGL though.

DrBanana419 avatar Dec 24 '20 10:12 DrBanana419

Update?

romulasry avatar Feb 27 '21 23:02 romulasry

@kisak-valve can you give us any updates what the status of this is? Maybe more details which parts of the stack need to be adapted/fixed?

konstantinblaesi avatar Apr 23 '21 19:04 konstantinblaesi

There has been a ton of Wayland support work done to SDL in the past few weeks; if anyone is so inclined, I'd appreciate if you build the latest from revision control (now on GitHub!) and see if it improves the situation.

If not, feel free to file bugs with SDL on this (also now on GitHub!), since I assume most of these sorts of issues are going to be related to SDL more than Dota2. We can always toss it back here if appropriate.

icculus avatar Apr 25 '21 21:04 icculus

last https://github.com/ValveSoftware/Dota-2-Vulkan/issues/282#issuecomment-700649906 now (SDL from git):

2021-04-26 20-09-13

sinaflan avatar Apr 26 '21 11:04 sinaflan

That error might be a Wayland bug or a Dota bug, but that specific thing probably isn't an SDL bug, fwiw.

There's a non-zero chance this is just Vulkan+Wayland isn't working on your system, though. Since you were comfortable building SDL from git, can you go into SDL/test, run configure/make, and then try running SDL_VIDEODRIVER=wayland ./testvulkan ...?

If you get a window that's just slowly fading from one solid color to the next, you definitely have a system that can handle the world's most simple Vulkan application on Wayland (and can hit ESC to close the window). If not, we know this is probably a system configuration issue or a driver bug.

If this does work...we'd have to see what Dota2 is doing under the hood...maybe it assumes a Vulkan graphics queue can also accept present commands, and panics if not, but that's just how Wayland sets things up but X11 doesn't? That seems unlikely for several reasons.

So let's try testvulkan first and rule out easy culprits.

icculus avatar Apr 30 '21 03:04 icculus

@icculus it works

222

sinaflan avatar Apr 30 '21 10:04 sinaflan

Then this is back in Valve's hands, sorry.

icculus avatar Apr 30 '21 10:04 icculus

new error

Снимок экрана от 2021-12-13 00-37-37

sinaflan avatar Dec 12 '21 15:12 sinaflan

EDIT: Sorry, false alarm. It does still not work. Steam didn't catch my "-vulkan" flag.


For me it's working now. Seems like the missing wl roots implementation of Vulkan caused the problem. I use the following version now:

 gandalf@mittelerde ~ pacman -Qi sway
Name                     : sway
Version                  : 1:1.6.1-3
Beschreibung             : Tiling Wayland compositor and replacement for the i3 window manager
Architektur              : x86_64
URL                      : https://swaywm.org/
Lizenzen                 : MIT
Gruppen                  : Nichts
Stellt bereit            : Nichts
Hängt ab von             : cairo  gdk-pixbuf2  json-c  pango  polkit  pcre  swaybg  ttf-font  wlroots
Optionale Abhängigkeiten : alacritty: Terminal emulator used by the default config
                           dmenu: Application launcher [Installiert]
                           grim: Screenshot utility
                           i3status: Status line [Installiert]
                           mako: Lightweight notification daemon
                           slurp: Select a region
                           swayidle: Idle management daemon
                           swaylock: Screen locker [Installiert]
                           wallutils: Timed wallpapers
                           waybar: Highly customizable bar
                           xorg-xwayland: X11 support [Installiert]
Benötigt von             : Nichts
Optional für             : Nichts
In Konflikt mit          : Nichts
Ersetzt                  : Nichts
Installationsgröße       : 5,58 MiB
Packer                   : Maxim Baz <[email protected]>
Erstellt am              : Mo 17 Jan 2022 11:30:12 CET
Installiert am           : Mo 17 Jan 2022 12:38:41 CET
Installationsgrund       : Ausdrücklich installiert
Installations-Skript     : Nein
Verifiziert durch        : Signatur

 gandalf@mittelerde ~ pacman -Qi wlroots 
Name                     : wlroots
Version                  : 0.14.1-3
Beschreibung             : Modular Wayland compositor library
Architektur              : x86_64
URL                      : https://gitlab.freedesktop.org/wlroots/wlroots
Lizenzen                 : MIT
Gruppen                  : Nichts
Stellt bereit            : libwlroots.so=9-64
Hängt ab von             : libinput  libseat.so=1-64  libxkbcommon  opengl-driver  pixman  xcb-util-errors  xcb-util-renderutil  xcb-util-wm
Optionale Abhängigkeiten : xorg-xwayland: Xwayland support [Installiert]
Benötigt von             : sway
Optional für             : Nichts
In Konflikt mit          : Nichts
Ersetzt                  : Nichts
Installationsgröße       : 988,16 KiB
Packer                   : Maxim Baz <[email protected]>
Erstellt am              : Mo 17 Jan 2022 11:19:35 CET
Installiert am           : Mo 17 Jan 2022 12:38:41 CET
Installationsgrund       : Installiert als Abhängigkeit eines anderen Pakets
Installations-Skript     : Nein
Verifiziert durch        : Signatur

cRaZy-bisCuiT avatar Jan 17 '22 13:01 cRaZy-bisCuiT

@cRaZy-bisCuiT Can you share a bit more details about your setup (e.g.: SDL version, mesa version, GPU)?

I'm also on Arch (btw) with the exact same version of sway and wlroots installed and I still get the error message mentioned earlier in this thread (https://github.com/ValveSoftware/Dota-2-Vulkan/issues/282#issuecomment-826749684).

vially avatar Jan 17 '22 19:01 vially

DRI_PRIME=1 LD_PRELOAD=/lib64/libSDL2-2.0.so.0 SDL_VIDEODRIVER=wayland %command%

still gives me amdgpu_error_graphics_queue_no_support_forswapchain_image

Using OpenGL by adding -gl makes it work but I would rather use vulkan:

DRI_PRIME=1 LD_PRELOAD=/lib64/libSDL2-2.0.so.0 SDL_VIDEODRIVER=wayland %command% -gl

Intel iGPU AMD RX 480 dGPU (driver amdgpu) Fedora 35

konstantinblaesi avatar Jan 17 '22 20:01 konstantinblaesi

Ubuntu 21.10 here If I launch Dota2 (vulkan) with LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 SDL_VIDEODRIVER=wayland I get same error like https://github.com/ValveSoftware/Dota-2-Vulkan/issues/282#issuecomment-1014876325 Screenshot from 2022-01-18 20-42-51

The system-provided lib looks quite old (it symlinks to libSDL2-2.0.so.0.14.0 )

If I try just SDL_VIDEODRIVER=wayland , I assume Dota2 use Valve's provided lib : ~/.steam/debian-installation/ubuntu12_32/steam-runtime/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (which is symlinked to a newer lib : libSDL2-2.0.so.0.16.0), I get same error like https://github.com/ValveSoftware/Dota-2-Vulkan/issues/282#issuecomment-991919753 image

Saroumane avatar Jan 18 '22 19:01 Saroumane

Sorry, false alarm. It does still not work. Steam didn't catch my "-vulkan" flag.

cRaZy-bisCuiT avatar Jan 19 '22 11:01 cRaZy-bisCuiT

I'm hoping that priority of fixing -vulkan with wayland native libSDL be revised.

As posted in latest Dota 2 announcement, this will be the last major update with -gl. To this day -gl was/is the only way to run Dota 2 on wayland natively without using rather buggy xwayland -- (Xorg -> wayland layer), which is even buggier on nvidia official drivers. I, for one, am using Dota's -gl on wayland without xwayland for more than a year or two, which I found most stable in my case.

As an added thought, it seems to me that librendersystemvulkan.so calls Xorg libs directly instead of using libSDL's WSI. As can be seen here:

$ ldd librendersystemvulkan.so

linux-vdso.so.1 (0x00007fff8bbed000)
libm.so.6 => /lib64/libm.so.6 (0x00007ff7f0bd0000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007ff7f0bcb000)
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/12/libstdc++.so.6 (0x00007ff7effe0000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff7f0bc6000)
libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007ff7effb6000)
librt.so.1 => /lib64/librt.so.1 (0x00007ff7f0bbf000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff7f0cd9000)
libtier0.so => /home/user/Games/SteamLibrary/steamapps/common/dota 2 beta/game/bin/linuxsteamrt64/./libtier0.so (0x00007ff7efa00000)
libc.so.6 => /lib64/libc.so.6 (0x00007ff7ef803000)
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/12/libgcc_s.so.1 (0x00007ff7eff96000)
libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007ff7eff91000)
libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007ff7eff89000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007ff7eff7f000)
libbsd.so.0 => /usr/lib64/libbsd.so.0 (0x00007ff7eff65000)
libmd.so.0 => /usr/lib64/libmd.so.0 (0x00007ff7eff57000)

To compare, here's how librendersystemgl.so looks like, which does appropriately use libSDL's WSI:

$ ldd librendersystemgl.so

linux-vdso.so.1 (0x00007ffebddfb000)
libm.so.6 => /lib64/libm.so.6 (0x00007f5fbc882000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f5fbc87d000)
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/12/libstdc++.so.6 (0x00007f5fbc1e0000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5fbc878000)
libudev.so.0 => /usr/lib64/libudev.so.0 (0x00007f5fbc873000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5fbc98b000)
libtier0.so => /home/user/Games/SteamLibrary/steamapps/common/dota 2 beta/game/bin/linuxsteamrt64/./libtier0.so (0x00007f5fbbc00000)
libSDL2-2.0.so.0 => /home/user/Games/SteamLibrary/steamapps/common/dota 2 beta/game/bin/linuxsteamrt64/./libSDL2-2.0.so.0 (0x00007f5fbb800000)
libc.so.6 => /lib64/libc.so.6 (0x00007f5fbb603000)
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/12/libgcc_s.so.1 (0x00007f5fbc851000)
libudev.so.1 => /lib64/libudev.so.1 (0x00007f5fbc817000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f5fbc80b000)
librt.so.1 => /lib64/librt.so.1 (0x00007f5fbc806000)

I would welcome -gl removal, if it was possible to use -vulkan with SDL_VIDEODRIVER=wayland as it is possible with -gl. To achive that, my guess is, -vulkan should stop calling Xorg out of the blue, as I've shown above, and use libSDL's WSI as librendersystemgl.so does.

mkjOoB avatar Nov 04 '22 19:11 mkjOoB

Can we please have @danginsburg to look at this since -gl is getting purged. https://github.com/ValveSoftware/Dota-2-Vulkan/issues/282#issuecomment-1304064179

mkjOoB avatar Nov 08 '22 22:11 mkjOoB