Wine seems broken on Intel+NVIDIA Optimus laptop using NVIDIA offload

Questions about Wine on Linux
Locked
F_style
Level 4
Level 4
Posts: 155
Joined: Sat Sep 25, 2010 8:55 pm

Wine seems broken on Intel+NVIDIA Optimus laptop using NVIDIA offload

Post by F_style »

Hello.

This time on an optimus laptop with this setup

openSUSE Leap 15.4
Wine 8.1

$ inxi -Gxz
Graphics:
Device-1: Intel HD Graphics 620 vendor: Lenovo driver: i915 v: kernel bus-ID: 00:02.0
Device-2: NVIDIA GM108M [GeForce 940MX] vendor: Lenovo driver: nvidia v: 525.78.01 bus-ID: 01:00.0
Device-3: Realtek Integrated Camera type: USB driver: uvcvideo bus-ID: 1-7:4
Display: x11 server: X.Org 21.1.7 driver: loaded: modesetting,nvidia resolution: 1366x768~60Hz
OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 22.3.5 direct render: Yes

This is follow-up of this past thread
viewtopic.php?t=36376

I tried with Playdead Limbo (both Steam and GOG versions)
https://appdb.winehq.org/objectManager. ... &iId=24128

Initialize with:

Code: Select all

WINEPREFIX="$HOME"/.wine32 WINEARCH=win32 winecfg
Run with:

Code: Select all

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia WINEPREFIX="$HOME"/.wine32 wine start /unix path/to/Limbo/limbo.exe
Results:

Code: Select all

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  156 (NV-GLX)
  Minor opcode of failed request:  43 ()
  Serial number of failed request:  301
  Current serial number in output stream:  302
What I've tried:

Code: Select all

$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa Intel(R) HD Graphics 620 (KBL GT2)
$
$ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep "OpenGL renderer"
OpenGL renderer string: NVIDIA GeForce 940MX/PCIe/SSE2
Running glxgears with and without the Nvidia offload (the __NV vars) works well in both cases.

I just described a particular case, but actually same error happens with other win games including 64bit.

Is this still a bug in Wine?
Thanks.
F_style
Level 4
Level 4
Posts: 155
Joined: Sat Sep 25, 2010 8:55 pm

Re: Wine seems broken on Intel+NVIDIA Optimus laptop using NVIDIA offload

Post by F_style »

I think it was solved:

Only use:
__NV_PRIME_RENDER_OFFLOAD=1

*Without using*:
__GLX_VENDOR_LIBRARY_NAME=nvidia

Which means Wine probably now runs purely over Vulkan... ??

Brief offtopic:
In my confusion and foolery, I accidentally ran a native Linux game via Wine, and to my surprise it did run. Why was this? Shouldn't this get an error?

Thanks.
F_style
Level 4
Level 4
Posts: 155
Joined: Sat Sep 25, 2010 8:55 pm

Re: Wine seems broken on Intel+NVIDIA Optimus laptop using NVIDIA offload

Post by F_style »

Updated conclusions:

Beforehand, for Nvidia Optimus rigs:
Run with offload GLX:

Code: Select all

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia WINEPREFIX=[...] wine [...]
Run with offload Vulkan:

Code: Select all

__NV_PRIME_RENDER_OFFLOAD=1 WINEPREFIX=[...] wine [...]
Game actually works on all cases (No offload (Intel), Nvidia offload GLX, Nvidia offload Vulkan), except on virtual desktop (any resolution) with Nvidia offload GLX for some reason, giving the error in OP...
Locked