mmtrt / cncra2yr-snap

Unofficial C&C: Red Alert 2 Yuri's Revenge soaked in WINE and Snapped for Linux

Home Page:https://snapcraft.io/cncra2yr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"X Error: GLXBadContext" when running on Ubuntu

ondrejchmelar opened this issue · comments

Hello,
first of all, thank you for the work on this gem of a game. It is wonderful that it is preserved more that 20 years after release.

I installed it last week and, played a couple hours, turned off and I'm unable to run ever since, getting this error:

$ cncra2yr
Starting application..
Running hook '/snap/cncra2yr/78/sommelier/hooks/pre-start'
X Error:  GLXBadContext
  Request Major code 152 (GLX)
  Request Minor code 6 ()
  Error Serial #175
  Current Serial #174

(IIRC I had to set export LIBGL_ALWAYS_INDIRECT=1 before the initial successful run, otherwise I also get libGL errors)

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

I tried running with SNAPD_DEBUG=1 SNAP_CONFINE_DEBUG=1 and noticed two warnings when running cncra2yr.winetricks:

warning: Your version of wine 3.0.4 is no longer supported upstream. You should upgrade to 5.x
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.

First I tried installing and connecting wine 5 snap connect cncra2yr:wine-3-stable wine-platform-5-stable but that feels hacky and didn't help.

I also tried creating a 32-bit wineprefix but it looks the WINEPREFIX envvar is not respected in snap, it fails with the same error.

WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine wineboot
WINEPREFIX="$HOME/prefix32" snap run cncra2yr

I'm running a fully updated Ubuntu 21.10, originally with nvidia-driver-470 for Nvidia eGPU. I've upgraded to 510 while trying to fix this, to no effect. I'm pretty sure the trouble is with some snap/wine setting as it initially worked. I'm not aware of any changes made before the problem appeared.

$ snap version
snap    2.54.3.2
snapd   2.54.3.2
series  16
ubuntu  21.10
kernel  5.13.0-30-generic

Any idea what could be the issue? Please let me know if you need more details on this.

can you post info of
apt list --installed | grep nvidia

also try opengl client
snap run cncra2yr.cncra2yrogl

ondrej@thinkpad:~$  apt list --installed | grep nvidia

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libnvidia-cfg1-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
libnvidia-common-510/impish,impish,now 510.54-0ubuntu0.21.10.1 all [installed]
libnvidia-compute-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
libnvidia-compute-510/impish,now 510.54-0ubuntu0.21.10.1 i386 [installed,automatic]
libnvidia-decode-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
libnvidia-decode-510/impish,now 510.54-0ubuntu0.21.10.1 i386 [installed,automatic]
libnvidia-egl-wayland1/impish,now 1:1.1.7-2build1 amd64 [installed,automatic]
libnvidia-encode-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
libnvidia-encode-510/impish,now 510.54-0ubuntu0.21.10.1 i386 [installed,automatic]
libnvidia-extra-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
libnvidia-fbc1-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
libnvidia-fbc1-510/impish,now 510.54-0ubuntu0.21.10.1 i386 [installed,automatic]
libnvidia-gl-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
libnvidia-gl-510/impish,now 510.54-0ubuntu0.21.10.1 i386 [installed,automatic]
nvidia-compute-utils-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
nvidia-dkms-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
nvidia-driver-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed]
nvidia-kernel-common-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
nvidia-kernel-source-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
nvidia-prime/impish,impish,now 0.8.17.1 all [installed]
nvidia-settings/impish-updates,impish,now 470.57.01-0ubuntu3.1~0.21.10.1 amd64 [installed,automatic]
nvidia-utils-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed]
xserver-xorg-video-nvidia-510/impish,now 510.54-0ubuntu0.21.10.1 amd64 [installed,automatic]
ondrej@thinkpad:~$  snap run cncra2yr.cncra2yrogl
Starting application..
Running hook '/snap/cncra2yr/78/sommelier/hooks/pre-start'
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error:  GLXBadContext
  Request Major code 152 (GLX)
  Request Minor code 6 ()
  Error Serial #235
  Current Serial #234

The error is slightly different with indirect

ondrej@thinkpad:~$  snap run cncra2yr.cncra2yrogl
Starting application..
Running hook '/snap/cncra2yr/78/sommelier/hooks/pre-start'
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error:  GLXBadContext
  Request Major code 152 (GLX)
  Request Minor code 6 ()
  Error Serial #235
  Current Serial #234
ondrej@thinkpad:~$ export LIBGL_ALWAYS_INDIRECT=1
ondrej@thinkpad:~$ snap run cncra2yr.cncra2yrogl
Starting application..
Running hook '/snap/cncra2yr/78/sommelier/hooks/pre-start'
X Error:  GLXBadContext
  Request Major code 152 (GLX)
  Request Minor code 6 ()
  Error Serial #175
  Current Serial #174

can you test this, first rename file remove .zip then install
snap install ./cncra2yr_1.0_multi.snap --dangerous

cncra2yr_1.0_multi.snap.zip

That certainly helped, I can run the launcher. I installed the updates, but get an error when lauching a skirmish game

wine: Unhandled page fault on write access to 0x00000003 at address 0x7dab0aef (thread 0051), starting debugger...
Can't attach process 0050: error 5

Seems to work fine with TS-DDraw renderer!

Awesome, thank you. What was the issue?

I've reverted this change from above snap, I guess I've to revert that change.
mmtrt/sommelier-core@3ce12ab

can you retest snap from stable branch now that I've built snap with that change remove.

snap refresh cncra2yr --stable --amend