ToGL icon indicating copy to clipboard operation
ToGL copied to clipboard

No display on Wayland with a NVIDIA GPU (Arch Linux, KDE Plasma 5.26)

Open Dupiter-AU opened this issue 1 year ago • 12 comments

While running games such as Team Fortress 2, Portal 2 and Counter Strike: Global Offensive, games do not render anything to the screen under XWayland. When forcing SDL_VIDEODRIVER=wayland in Team Fortress 2 with the libSDL replacement recommended by mastercomfig, the game does successfully render to the screen, however the game will freeze and crash not long after launch. I have attempted to look for error messages in steam console and in the output console from both the in-game console and in the console from launching the hl2.sh script from konsole, but I could not find anything of use.

I have confirmed this is an issue related to NVIDIA by testing both on my AMD Vega 8 laptop and my 2060 Super desktop PC. The games work perfectly under Wayland on AMD, but not on NVIDIA. Both the new open source NVIDIA drivers and the proprietary drivers have this problem.

I have also confirmed this is a problem with ToGL. When Portal 2 and certain other source games are launched in Vulkan using -vulkan, the game displays to the screen perfectly and has no problems. Without vulkan, the games do not render.

This issue is related to issue #3871 found in the Source-1-Games repository, however no progress or even developer communication has been made so far on that issue.

Dupiter-AU avatar Oct 13 '22 08:10 Dupiter-AU

My system: ArchLinux, GNOME (Wayland), NVIDIA (Proprietary)

I too can't play TF2. The game runs for me, but the menu HUD doesn't appear. I can hear the music playing, I can even blindly press "tilde" and type "exit" to close the game gracefully.

mark-russ avatar Oct 15 '22 04:10 mark-russ

Also experiencing the same issue. It seems to vary across versions, I can play Garry's Mod fine as an example.

SilverMight avatar Oct 23 '22 17:10 SilverMight

try to launch it using native SDL (as described here), SDL_VIDEODRIVER=x11, and with anti-aliasing disabled

getchoo avatar Oct 30 '22 01:10 getchoo

@getchoo That results in only the loading screen rendering instead of a black screen, which I guess is progress. There's still the issue of the game not updating frames. I can click buttons on the main menu, but I can't see anything because it's obscured by the loading screen.

Tank-Missile avatar Oct 30 '22 01:10 Tank-Missile

did you delete the builtin version of SDL? i've tested this on TF2 with multiple distros (with the proprietary kernel module, maybe the open source version differs with this) and it's never had that problem

getchoo avatar Oct 30 '22 02:10 getchoo

@getchoo Yes. I deleted the builtin version of SDL. I also deleted videoconfig_linux.cfg to start fresh and ensured mat_antialias was set to 0. I'm using the proprietary kernel driver on a GTX 1070.

Tank-Missile avatar Oct 30 '22 02:10 Tank-Missile

if you use mastercomfig, disable it by using the modules (anti_aliasing=off in tf/cfg/overrides/modules.cfg). if you don't, put the commands used here in your autoexec and try again

getchoo avatar Oct 30 '22 02:10 getchoo

@getchoo I'm not using masterconfig, but I was using a bunch of custom config files. I deleted the cfg folder and started the game again, and it actually worked! I'm not sure what's causing the issue from the cfgs. You can take a look at them here.

Tank-Missile avatar Oct 30 '22 02:10 Tank-Missile

not sure, but i'm guessing it's one of the cvars in optimization.cfg - maybe r_queued_post_processing since iirc that can change the video mode tf2 uses. i would try mastercomfig though, has similar cvars as your config, but with better values along with even more optimizations - plus you could avoid issues like these :p

getchoo avatar Oct 30 '22 02:10 getchoo

I can confirm that anti-aliasing causes the display to be broken (in Team Fortress 2). Disabling the anti aliasing module in mastercomfig allows the game to render fine, which is a real shame.

EDIT 1: This problem does appear to be directly related to anti-aliasing. Counter Strike Global Offensive launched after a while when I disabled AA and displayed without a hitch. I attempted to test Portal 2 but it wasn't launching for some reason

EDIT 2: This does not work for Portal 2.

Dupiter-AU avatar Oct 31 '22 06:10 Dupiter-AU

Attached is a video showcasing the effects of toggling CS:GO's anti-aliasing setting while in-game. https://user-images.githubusercontent.com/82429716/198947109-67040d57-20da-450f-8779-f64bc8f3bd9d.mp4

Dupiter-AU avatar Oct 31 '22 06:10 Dupiter-AU

I use swaywm and nvidia drivers. Adding -windowed -noborder command-line options for TF2 fixed it for me: image

Invertisment avatar Jan 27 '24 18:01 Invertisment