mrxz / webxr-linux

Repository containing efforts in getting usable WebXR under Linux
35 stars 4 forks source link

No luck (so far) getting these to run [Nvidia] #1

Open s4y opened 2 years ago

s4y commented 2 years ago

I'm trying these patches on an Arch Linux system and not having any luck.

Both the dmabuf patch and the glx patch let me start an XR session, and both just result in a black screen on the headset. If I'm using the dmabuf version of the patch, I see this printed periodically:

Crash Annotation GraphicsCriticalError: |[C0][GFX1]: ToSurfaceDescriptor failed in VRLayerChild::SubmitFrame (t=22.4654) [GFX1]: ToSurfaceDescriptor failed in VRLayerChild::SubmitFrame

There are no printed errors with the glx patch. I tried the plain patch (glReadPixels), too, and it causes Firefox to crash on starting any WebGL context:

Exiting due to channel error. Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=6.86694) Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: Receive IPC close with reason=AbnormalShutdown (t=7.47218) Exiting due to channel error.

Here's my system:

Any ideas or troubleshooting thoughts would be much appreciated!

mrxz commented 2 years ago

That's unfortunate. I just tried both the dmabuf and glReadPixel patches on the Firefox tip (r700545) and both did still work for me (although the dmabuf one did crash after some minutes :sweat:). Running the same SteamVR version as you 1.22.13.

I have the feeling the issue is likely due to using NVIDIA. Sadly I don't have an NVIDIA card to test with. But to rule out some other factors, things I make sure of:

These patches are still hacks at the end of the day. Conceptually the glReadPixels approach is the easiest and arguably the least hackish. I'm surprised that this one causes any WebGL context to crash for you. Perhaps debugging that crash might shed more light on the cause.

What you could try is playing around with the code in gfx/gl/SharedSurfaceGL.cpp when using the glReadPixels patch. If you leave out both the fBindFramebuffer and fReadPixel calls, it should result in a black screen in the HMD. If that does work, either the previously bound framebuffer needs to be restored, or the fReadPixel call is invalid (e.g. the framebuffer is multisampled).

I hope this gives you some ideas and things to try. Keep me posted if you make any progress or find something.

Utopiah commented 2 years ago

Getting similar results on Ubuntu 22.04, also 515.65.01 with 1.22.13. ./mach patch/build/run work without problem, SteamVR does get "firefox" when pressing "enter VR" yet the screen is black.

fabien@fabien-CORSAIR-ONE-i160:~/Prototypes/firefox/mozilla-unified$ ./mach run
 0:00.34 /home/fabien/Prototypes/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/dist/bin/firefox -no-remote -profile /home/fabien/Prototypes/firefox/mozilla-unified/obj-x86_64-pc-linux-gnu/tmp/profile-default
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: VA-API test failed: failed to initialise VAAPI connection. (t=0.0815473) [GFX1-]: glxtest: VA-API test failed: failed to initialise VAAPI connection.
[2022-08-14T20:48:49Z ERROR glean_core::metrics::ping] Invalid reason code startup for ping newtab
/home/fabien/.steam/debian-installation/steamapps/common/SteamVR/bin/vrwebhelper/linux64/vrwebhelper.sh: line 17: STEAMVR_VRENV: unbound variable
ATTENTION: default value of option mesa_glthread overridden by environment.
Olm-e commented 2 years ago

just to confirm I could make it work with an AMD rx 5600 xt ... so probably nvidia driver related bug ;)

rcelyte commented 2 years ago

Works on my RX 580, but crashes after some minutes as @mrxz mentioned.

Utopiah commented 2 years ago

I don't have an NVIDIA card to test with.

If that helps @mrxz I can setup a cloud instance with an NVIDIA GPU then share access. It wouldn't have VR working (CloudXR on Linux is not out yet) but it might help spot what the problem is, eventually surface it back to NVIDIA or wherever the problem belongs.

mrxz commented 2 years ago

If that helps @mrxz I can setup a cloud instance with an NVIDIA GPU then share access.

Thanks for the offer @Utopiah, but the biggest challenge will be finding time to dive into the issue... I do have a laptop with an Nvidia card that I could perhaps try it on, so I'll see if I can get around to it.

Works on my RX 580, but crashes after some minutes as @mrxz mentioned.

Thanks for trying it out, @rcelyte. Just to clarify, while I also reported it to 'crash' it's more a hang/freeze. Did you observe the same, or did it really crash Firefox for you?

rcelyte commented 2 years ago

@mrxz It froze

Utopiah commented 2 years ago

biggest challenge will be finding time to dive into the issue... I do have a laptop with an Nvidia card that I could perhaps try it on, so I'll see if I can get around to it.

Understood, let me know if there is anything I can test and whatever data, error log, etc that could help.