I cannot run L4D2 nor Portal

I’m using nvidia prime, this is my configuration.nix: https://github.com/Denommus/nix-configurations/blob/b2341cb074e95816c42122fbacc3ff2070e5128d/global/nixos/configuration.nix

Most games work, including Dota 2 and some Proton games such as Monster Hunter World. But I cannot run Portal nor L4D2 for some reason.

This is the output on the terminal:

GameAction [AppID 400, ActionID 2] : LaunchApp changed task to ProcessingInstallScript with ""
GameAction [AppID 400, ActionID 2] : LaunchApp changed task to SynchronizingCloud with ""
GameAction [AppID 400, ActionID 2] : LaunchApp changed task to SiteLicenseSeatCheckout with ""
GameAction [AppID 400, ActionID 2] : LaunchApp changed task to CreatingProcess with ""
GameAction [AppID 400, ActionID 2] : LaunchApp waiting for user response to CreatingProcess ""
GameAction [AppID 400, ActionID 2] : LaunchApp continues with user response "CreatingProcess"
Game update: AppID 400 "", ProcID 261, IP 0.0.0.0:0
ERROR: ld.so: object '/home/yuri/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/yuri/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
pid 263 != 262, skipping destruction (fork without exec?)
ERROR: ld.so: object '/home/yuri/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/yuri/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
SDL video target is 'x11'
SDL video target is 'x11'
Failed to create SDL window: Couldn't find matching GLX visualStarting app 400
Loaded Config for Local Selection Path for App ID 400, Controller 0: /home/yuri/.local/share/Steam//controller_base/templates/controller_ps4_gamepad_fps.vdf
>>> Adding process 261 for game ID 400
GameAction [AppID 400, ActionID 2] : LaunchApp changed task to WaitingGameWindow with ""
>>> Adding process 262 for game ID 400
>>> Adding process 264 for game ID 400
>>> Adding process 265 for game ID 400
GameAction [AppID 400, ActionID 2] : LaunchApp changed task to Completed with ""
Installing breakpad exception handler for appid(steam)/version(1604538810)
Installing breakpad exception handler for appid(steam)/version(1604538810)
Installing breakpad exception handler for appid(steam)/version(1604538810)
Installing breakpad exception handler for appid(steam)/version(1604538810)
Game removed: AppID 400 "", ProcID 261 
Uploaded AppInterfaceStats to Steam
Exiting app 400
No cached sticky mapping in ActivateActionSet.No cached sticky mapping in ActivateActionSet.

The important part seems to be “Failed to create SDL window: Couldn’t find matching GLX visual”, which also appears as a popup window when I try to run the game.

One important thing to notice is that this happens with or without nvidia-offload.

I have tried to switch to sync instead of offload, with no luck. I have no idea what could be happening.

I forgot to add my system information as captured by Steam:

Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Laptop
No Touch Input Detected

Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core™ i5-6300HQ CPU @ 2.30GHz
CPU Family: 0x6
CPU Model: 0x5e
CPU Stepping: 0x3
CPU Type: 0x0
Speed: 3200 Mhz
4 logical processors
4 physical processors
HyperThreading: Unsupported
FCMOV: Supported
SSE2: Supported
SSE3: Supported
SSSE3: Supported
SSE4a: Unsupported
SSE41: Supported
SSE42: Supported
AES: Supported
AVX: Supported
AVX2: Unsupported
AVX512F: Unsupported
AVX512PF: Unsupported
AVX512ER: Unsupported
AVX512CD: Unsupported
AVX512VNNI: Unsupported
SHA: Unsupported
CMPXCHG16B: Supported
LAHF/SAHF: Supported
PrefetchW: Unsupported

Operating System Version:
“NixOS 21.03 (Okapi)” (64 bit)
Kernel Name: Linux
Kernel Version: 5.4.77
X Server Vendor: The X.Org Foundation
X Server Release: 12009000
X Window Manager: KWin
Steam Runtime Version:

Video Card:
Driver: NVIDIA Corporation GeForce GTX 960M/PCIe/SSE2
Driver Version: 4.6.0 NVIDIA 455.28
OpenGL Version: 4.6
Desktop Color Depth: 24 bits per pixel
Monitor Refresh Rate: 60 Hz
VendorID: 0x8086
DeviceID: 0x191b
Revision Not Detected
Number of Monitors: 1
Number of Logical Video Cards: 1
Primary Display Resolution: 1920 x 1080
Desktop Resolution: 1920 x 1080
Primary Display Size: 13.54" x 7.64" (15.51" diag)
34.4cm x 19.4cm (39.4cm diag)
Primary VRAM: 4096 MB

Sound card:
Audio device: Realtek ALC269VC

Memory:
RAM: 15938 Mb

VR Hardware:
VR Headset: None detected

Miscellaneous:
UI Language: English
LANG: en_US.UTF-8
Total Hard Disk Space Available: 937368 Mb
Largest Free Hard Disk Block: 265826 Mb

CClientJobGatherRuntimeInformation: read output failed

maybe this post can help you.

I’ve tried that solution, but it seems specific to AMD, it didn’t work for me.

Hmm… this could be tricky to fix…if other games are working ok, your GL must be working to a certain extent.

Maybe those games need a certain revision of either drivers, GL or Mesa libraries…

It’s always a bane to get games working in any linux distro… Perhaps somebody who has those games working can share the driver/GL/Mesa library versions that the are using and you can try and get to match those level.

Reading a lot of commit chatter on GL drivers, it’s a mess, now wonder it’s called ‘mesa’. Add the fact Nvidia make it a total botch with there horrid kernel drivers, mysterious binary blobs, and non-free drivers… :-(. One day there will be open graphics chips…that are documented and open… one day.

sorry i couldn’t be more help. In space (opengl) no one can hear you scream.

for the sake of completeness post your glxinfo

nix run nixos.glxinfo -c glxinfo

or

nix-shell -p glxinfo --run "glxinfo"

it’s not nixos specific… and might be red herring…

mines a old card, which reports 276 GLX Visuals and 359 GLXFBConfigs

You support only
12 GLX Visuals 215 GLXFBConfigs:

so maybe this is unrelated, or your SDL is trying to pick a SDL mode that is not available on your card (for some reason).

again, this might be wild goose chase…

ok i don’t know if this is good news, but i copied some your helpful config onto my machine
(after getting a glXChooseVisual failed when trying to run steam).

And it worked… steam started up. (i’m not using a 960M however, or prime / offloading …it’s a desktop)

Installed portal, and it also worked.

However, it’s slow as hell at larger resolutions… but lower resolutions seem fine…
mainly because my nvida card is so old , it actually runs on ‘steam power’.

Please send me a video card!!! :-)…

However, nixos runs it… with not much fuss… i’m impressed.

Doesn’t help your situation, but i guess it’s something to do with prime offloading stuff and it being a 960M Chip… i hope you can get the bottom of it.

What is weird is that Portal used to work when I used Arch Linux, it makes no sense for my card to only have 12 GLX visuals available.

I feel your frustration, but Nixos isn’t Arch… It could be that Arch patches something to make this 960M mobile chip work, or it’s a combination of drivers versions etc etc.

It would be interesting if you can Boot into arch (if you have dual boot) (or perhaps with an ISO or usb stick) and compare drivers revisions, GLX contexts and perhaps there’s a patch that arch does to make it run.

The complexity of the library interdepencies does not help matters either.

I still couldn’t figure out why I only have 12 GLX Visuals, but according to this benchmarks website the normal for my board is 132: ASUS NVIDIA GeForce GTX 960M Benchmarks, Linux Performance - OpenBenchmarking.org

I think I’m getting in the bottom of this. My xserver.conf has the following:

Section "Device"
  Identifier "Device-nvidia[0]"
  Driver "nvidia"
  Option "AccelMethod" "glamor"
  
  BusID "PCI:1:0:0"
Option "AllowExternalGpus"

  
EndSection

I strongly believe it’s missing the options Option "AllowGLXWithComposite" "true" and Option "AddARGBGLXVisuals" "true".

Ok, yesterday I noticed the screen section for nvidia in my xserver.conf is NOT being generated.

It seems this was the problem all along: Steam games fail to start with "Couldn't find matching GLX visual" · Issue #106503 · NixOS/nixpkgs · GitHub

After I used LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/run/opengl-driver-32/lib" %command% in the game’s launch options, the game executed.

1 Like

I think enabling hardware.opengl.setLdLibraryPath would work as well.

This modified my LD_LIBRARY_PATH in my system, but for some reason it did not fix the problem in Steam games, setting the launch options is still necessary.

Huh, that’s odd. I assume you rebooted and everything, so I have no idea why one works and the other doesn’t. Still, I’m glad you managed to get it working at all.

Indeed I rebooted and everything.

I just noticed steam/fhsenv: Add LD_LIBRARY_PATH (and hence OpenGL driver library path) to output of --print-steam-runtime-library-paths by jbalme · Pull Request #106843 · NixOS/nixpkgs · GitHub linked in the issue you linked, which says:

Needed because Steam now replaces LD_LIBRARY_PATH with the runtime’s path, instead of prepending.

So that (probably?) explains it.

2 Likes