Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGL not working with 3.0.90-20230201 #228

Closed
langeschro opened this issue Mar 6, 2023 · 15 comments
Closed

WebGL not working with 3.0.90-20230201 #228

langeschro opened this issue Mar 6, 2023 · 15 comments

Comments

@langeschro
Copy link

WebGL is not working with Chrome and Firefox after updating to 3.0.90-20230201.
This works again after changing the version to 3.0.2-20230201
OS is Rocky Linux 8 and I've been using an Nvidia T4 GPU with driver version 525.60.13

A simple test is to visit https://get.webgl.org/
There should be a spinning cube if WebGL is working.

dcommander added a commit that referenced this issue Mar 7, 2023
Some applications, including Firefox, support both EGL/X11 and GLX, so
VGL shouldn't throw a fatal error if those applications call
eglGet*Display() to probe for EGL/X11 support.

I suspect that this fixes the Firefox complaint in #228.

NOTE: From a usability point of view, it would seemingly be nicer to
automatically use an EGL device with the EGL/X11 interposer, but that
would require introducing a separate environment variable/command-line
option so that an EGL device could be specified for the EGL/X11
interposer without forcing the EGL back end to be used with the GLX
interposer.  At the moment, it makes more sense to tie the EGL/X11
interposer to the EGL back end, since the GLX back end is primarily a
backward compatibility feature.
@dcommander
Copy link
Member

dcommander commented Mar 7, 2023

The primary purpose of the VirtualGL 3.1 release series is to introduce an EGL/X11 interposer to support Chrome and Firefox and other applications (VLC, etc.) that have migrated from GLX to EGL/X11. Chrome supports (supported?) another OpenGL path using low-level XCB-GLX functions, but VirtualGL's XCB interposer is not sophisticated enough to support that path. (Our XCB interposer does only the minimum necessary to support Qt, so it isn't a complete XCB-GLX interposer.) It was easier to just interpose EGL/X11 rather than try to interpose all of XCB-GLX. Thus, you may have been able to use VirtualGL 3.0.2 with Chrome, but I seriously doubt that it was GPU-accelerated.

There was an issue in VirtualGL 3.1 beta1 whereby the interposed eglGet*Display() functions threw a fatal error if the GLX back end was in use. That caused the glxtest subprocess in Firefox to fail, which prevented Firefox from falling back gracefully to GLX. In short, it was necessary to use the EGL back end with VGL 3.1 beta1 in order for GPU acceleration to be enabled in any recent version of Firefox. However, that was a regression against VirtualGL 3.0.x, which allowed Firefox to fall back gracefully to GLX when using the GLX back end. I suspect that that was the source of your complaint vis-a-vis Firefox. Please retest with the 3.1 post-beta pre-release build, which has a version number of 3.0.91.

General notes

  • It is necessary to use the EGL back end with the EGL/X11 interposer. The EGL back end isn't enabled by default, so you have to explicitly enable it by passing -d egl to vglrun or setting VGL_DISPLAY=egl in the environment. Firefox will now fall back gracefully and use GLX if the EGL back end is not in use, but Chrome requires EGL/X11 (and thus it requires the EGL back end.)
  • Chrome supports two EGL/X11 modes: OpenGL ES and desktop EGL. When it tries to use OpenGL ES, it does something really stupid that breaks VirtualGL. (See (Docs) New chromium v108 needs --use-gl=egl #222.) Thus, it is necessary to pass --use-gl=egl to google-chrome or chromium-browser in order to force Chrome/Chromium to use desktop OpenGL, which bypasses the stupid behavior in its OpenGL ES implementation.
  • All tests were conducted with CentOS 7.9.2009, TurboVNC 3.0.3, and nVidia 470.103.01 and 525.89.02.

Firefox

Definition of "Success" with Firefox

  1. A "VGL" logo appears in the lower right of the browser window if VGL_LOGO=1 is set in the environment.
  2. The Graphics section under about:support shows "WebRender" in the Compositing item, and it shows information about the GPU drivers in the WebGL 1 Driver* items and under the GPU #⁠1 subsection.
  3. https://get.webgl.org shows a spinning cube, and the VirtualGL trace output shows repeated sequences of eglMakeCurrent(), eglQuerySurface(), glViewport(), and eglSwapBuffers() function calls or glXGetCurrentContext(), glViewport(), and glXSwapBuffers() function calls.

Definition of "Failure" with Firefox

  1. A "VGL" logo does not appear in the lower right of the browser window if VGL_LOGO=1 is set in the environment.
  2. The Graphics section under about:support shows "WebRender (Software)" in the Compositing item, no information about the GPU drivers and/or "WebGL creation failed" in the WebGL 1 Driver* items and under the GPU #⁠1 subsection, and "No GPUs detected via PCI" under Failure Log.
  3. https://get.webgl.org shows "Hmm. While your browser seems to support WebGL, it is disabled or unavailable. If possible, please ensure that you are running the latest drivers for your video card."

Observed behavior

VirtualGL 3.0.2 and 3.0.91, Firefox v80-v106 (did not test versions prior to v80)

  • VGL_LOGO=1 vglrun [-d egl] +tr firefox: Success
    • v88 and prior use a method other than glXSwapBuffers() to draw OpenGL-rendered pixels into the browser window, so the "VGL" logo is not displayed. However, OpenGL rendering is still GPU-accelerated.
    • v89 and later exhibit a sporadic issue whereby some parts of the browser window do not update properly. It is unknown whether this is an issue with VirtualGL or TurboVNC or Firefox itself. It may be related to Distorted graphics in Gnome-Terminal TurboVNC/turbovnc#362.
    • With v93 and prior, it is necessary to set MOZ_DISABLE_CONTENT_SANDBOX=1 in the environment when using the GLX back end. Otherwise, VirtualGL prints an error (ERROR: Could not open display :0), and the WebGL tab crashes.
    • v87 and later show "glxtest: libEGL missing eglGetDisplayDriverName" under about:support-->Graphics-->Failure Log. Apparently Firefox's glxtest sub-process attempts to use EGL/X11 but fails because it expects the EGL_MESA_query_driver extension to be available, and nVidia's EGL stack does not support that extension. This always occurs with VGL 3.0.2. With VGL 3.0.91, it occurs when using the EGL back end. (With the GLX back end, "glxtest: libEGL no display" is shown instead, reflecting the fact that, since 7a2d5c7, the EGL/X11 interposer fails gracefully when using the GLX back end.) In short, Firefox v87-v106 falls back to GLX when using nVidia's EGL stack, even if EGL/X11 is available.

VirtualGL 3.0.2, Firefox v107-v110

  • VGL_LOGO=1 vglrun [-d egl] +tr firefox: Partial success
    • A "VGL" logo does not appear in the lower right of the browser window if VGL_LOGO=1 is set in the environment.
    • The Graphics section under about:support shows "WebRender (Software)" in the Compositing item, information about the GPU drivers in the WebGL 1 Driver* items, and information about the llvmpipe (software OpenGL) driver under the GPU #⁠1 subsection.
    • https://get.webgl.org shows a spinning cube, but the VirtualGL trace output shows only glFlush() and (in v109 and prior) glXGetCurrentContext() function calls. From the output of nvidia-smi, OpenGL rendering appears to be GPU-accelerated, but compositing apparently isn't. Thus, the update issue observed in v89-v106 does not occur, and the "glxtest: libEGL missing eglGetDisplayDriverName" error is not present.

VirtualGL 3.0.91, Firefox v107-v110

  • VGL_LOGO=1 vglrun -d egl +tr firefox: Success
    • EGL/X11 is used.
    • The aforementioned update issue does not occur.
  • VGL_LOGO=1 vglrun +tr firefox: Success
    • GLX is used.
    • The aforementioned update issue occurs with v109 and prior.

Conclusions

  • Firefox < v107 can't use EGL/X11 with the nVidia EGL stack, but GLX still works.
  • An application recipe for recent versions of Firefox isn't actually needed yet, since the latest version of Firefox can still fall back to GLX (now that VGL allows it to.)
  • An application recipe for Firefox < v94 is needed, in order to document the need for MOZ_DISABLE_CONTENT_SANDBOX=1.

Chrome/Chromium v110-v111

NOTE: Prior to releasing VirtualGL v3.1 beta1, I did a similar study to the above with Chrome, so I am confident that the existing Chrome/Chromium app recipe in the VGL User's Guide is correct. This section simply reiterates those findings vis-a-vis the latest version.

Definition of "Success" with Chrome/Chromium

  • A "VGL" logo appears in the lower right of the browser window if VGL_LOGO=1 is set in the environment.
  • chrome://gpu shows "Hardware accelerated" for "Canvas", "Compositing", "Rasterization", "Video Decode", "WebGL", and "WebGL2", and it shows "Enabled" for "Multiple Raster Threads" and "OpenGL".
  • https://get.webgl.org shows a spinning cube, and the VirtualGL trace output shows repeated sequences of eglGetCurrentSurface(), glViewport() and eglSwapBuffers() function calls.

Definition of "Failure" with Chrome/Chromium

  • A "VGL" logo does not appear in the lower right of the browser window if VGL_LOGO=1 is set in the environment.
  • chrome://gpu shows "Software only" for "Canvas", "Compositing", "Rasterization", "Video Decode", "WebGL", and "WebGL2", and it shows "Disabled" for "Multiple Raster Threads" and "OpenGL".
  • https://get.webgl.org shows "Hmm. While your browser seems to support WebGL, it is disabled or unavailable. If possible, please ensure that you are running the latest drivers for your video card."

Observed behavior

VirtualGL 3.0.2

  • VGL_LOGO=1 vglrun +tr [-d egl] {google-chrome|chromium-browser} --use-gl=egl --disable-seccomp-filter-sandbox: Partial failure
    • Error from Chrome/Chromium of the form [*:ERROR:gl_display.cc(*)] EGL Driver message (Error) eglCreateContext: dri2_create_context
    • Error from Chrome/Chromium of the form [*:ERROR:command_buffer_proxy_impl.cc(*)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
    • A "VGL" logo does not appear in the lower right of the browser window if VGL_LOGO=1 is set in the environment.
    • chrome://gpu shows "Hardware accelerated" for "Rasterization" but "Software only" for "Canvas" and "Compositing", it shows "Enabled" for "Multiple Raster Threads", and it shows "Unavailable" for "OpenGL", "Video Decode", "WebGL", and "WebGL2".
    • https://get.webgl.org shows "Hmm. While your browser seems to support WebGL, it is disabled or unavailable. If possible, please ensure that you are running the latest drivers for your video card."
  • Without --use-gl=egl: Partial failure
    • Multiple errors from Chrome/Chromium of the form [*:ERROR:angle_platform_impl.cc(*)] Display.cpp:* (initialize): ANGLE Display::initialize error 12289: Invalid visual ID requested.
    • Multiple errors from Chrome/Chromium of the form
      [*:ERROR:gl_display.cc(*)] EGL Driver message (Critical) eglInitialize: Invalid visual ID requested.
    • Multiple errors from Chrome/Chromium of the form [*:ERROR:gl_display.cc(*)] eglInitialize OpenGL failed with error EGL_NOT_INITIALIZED, trying next display type
    • Multiple errors from Chrome/Chromium of the form [*:ERROR:gl_display.cc(*)] eglInitialize OpenGLES failed with error EGL_NOT_INITIALIZED
    • Multiple errors from Chrome/Chromium of the form [*:ERROR:gl_ozone_egl.cc(*)] GLDisplayEGL::Initialize failed.
    • Multiple errors from Chrome/Chromium of the form [*:ERROR:viz_main_impl.cc(*)] Exiting GPU process due to errors during initialization
    • Error from Chrome/Chromium of the form [*:ERROR:command_buffer_proxy_impl.cc(*)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
    • A "VGL" logo does not appear in the lower right of the browser window if VGL_LOGO=1 is set in the environment.
    • chrome://gpu shows "Software only" for "Canvas", "Compositing", "Rasterization", "Video Decode", "WebGL", and "WebGL2", and it shows "Enabled" for "Multiple Raster Threads" and "Disabled" for "OpenGL".
    • https://get.webgl.org shows a spinning cube, but the VirtualGL trace output and nvidia-smi show nothing. (WebGL is working but unaccelerated.)

VirtualGL 3.0.91

  • VGL_LOGO=1 vglrun +tr -d egl {google-chrome|chromium-browser} --use-gl=egl --disable-seccomp-filter-sandbox: Success
    • I get a lot of innocuous errors of the form ERROR: ld.so: object 'lib*faker.so' from LD_PRELOAD cannot be preloaded: ignored. Refer to this section of the User's Guide for information regarding how to suppress those.
    • Other users have reported that they don't need to pass --disable-seccomp-filter-sandbox to Chrome/Chromium, but I have always needed to do that. (See below.)
  • Without -d egl: Failure
    • Multiple errors from Chrome/Chromium of the form [*:ERROR:gl_display.cc(*)] EGL display query failed with error EGL_SUCCESS
    • Multiple errors from Chrome/Chromium of the form [*:ERROR:gpu_process_host.cc(*)] GPU process exited unexpectedly: exit_code=11
  • Without --disable-seccomp-filter-sandbox: Failure
    • Multiple errors from VirtualGL of the form ERROR: in VirtualWin-- *: Could not clone X display connection
    • Multiple errors from Chrome/Chromium of the form [*:ERROR:gpu_process_host.cc(*)] GPU process exited unexpectedly: exit_code=256
    • Error from Chrome/Chromium of the form [*:ERROR:command_buffer_proxy_impl.cc(*)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer
    • Error from Chrome/Chromium of the form [*:ERROR:gl_display.cc(*)] EGL Driver message (Error) eglCreateContext: EGL_BAD_ATTRIBUTE error: In eglCreateContext: Unknown attribute name (0x3453)
    • Error from Chrome/Chromium of the form [*:ERROR:gl_context_egl.cc(*)] eglCreateContext failed with error EGL_SUCCESS
    • Error from Chrome/Chromium of the form [*:ERROR:gpu_info_collector.cc(*)] gl::init::CreateGLContext failed
    • Error from Chrome/Chromium of the form [*:ERROR:gpu_info_collector.cc(*)] Could not create context for info collection.
    • Error from Chrome/Chromium of the form [*:ERROR:gpu_init.cc(*)] CollectGraphicsInfo failed.
    • Error from Chrome/Chromium of the form [*:ERROR:viz_main_impl.cc(*)] Exiting GPU process due to errors in initialization
  • Without --use-gl=egl: Partial success
    • Error from Chrome/Chromium of the form [*:ERROR:gl_surface_egl.cc(*)] eglCreateWindowSurface failed with error EGL_BAD_CONFIG
    • A "VGL" logo does not appear in the lower right of the browser window if VGL_LOGO=1 is set in the environment.
    • chrome://gpu shows "Hardware accelerated" for "Canvas", "Rasterization", and "Video Decode"; "Software only" for "Compositing"; "Hardware accelerated but at reduced performance" for "WebGL" and "WebGL2"; and "Enabled" for "Multiple Raster Threads" and "OpenGL".
    • https://get.webgl.org shows a spinning cube, but the VirtualGL trace output shows only glViewport() function calls. From the output of nvidia-smi, OpenGL rendering appears to be GPU-accelerated, but compositing apparently isn't.

Conclusions

  • EGL/X11 is needed in order to get full GPU acceleration with recent versions of Chrome/Chromium.
  • The application recipe in the VGL 3.1 User's Guide is correct.

@dcommander
Copy link
Member

tl;dr

When using the latest VGL 3.1 post-beta pre-release build, Firefox should now work as it did with VGL 3.0.2. I strongly suspect that Chrome/Chromium didn't work because you weren't following the application recipe, but please let me know if you still observe a failure after following that recipe.

@dcommander
Copy link
Member

I have been investigating the update issue observed with Firefox v89-v106. It is definitely VirtualGL-specific, as I can reproduce the issue on the local display with VirtualGL but not without VirtualGL. I have tried setting VGL_GLFLUSHTRIGGER=0, VGL_SPOIL=0, VGL_SPOILLAST=0, VGL_SYNC=1, and VGL_USEXSHM=0, with no effect. Since the issue stopped occurring with v107, I'm going to file it under "SEP" for now.

@dcommander
Copy link
Member

@langeschro Please test the latest VirtualGL 3.1 post-beta pre-release (https://virtualgl.org/DeveloperInfo/PreReleases) using the documented recipes for Firefox and Chrome (a recipe is only needed with Firefox < v94) and confirm whether the issues are fixed.

@dcommander
Copy link
Member

@langeschro A timely response is appreciated. The VirtualGL 3.1 release is overdue, and I need independent confirmation that this issue is fixed.

@langeschro
Copy link
Author

Hi @dcommander thanks for your response, this is extremely helpful.
I will try to run some tests with the latest release later today or tomorrow.

@langeschro
Copy link
Author

langeschro commented Mar 13, 2023

Tried the 3.0.91 version now that was uploaded yesterday.

Firefox (102.8.0esr 64bit):
Success - Working without further changes again as in 3.0.2
Also tried: VGL_LOGO=1 vglrun +tr firefox
(VGL logo, Spinning cube, WebRender shown, recognized Nvidia driver)
When adding "-d egl" to Firefox I get the error "The EGL back end requires a 2D X server with a GLX extension."

Chrome (110.0.5481.100 64bit):
Not working

It seems like EGL is not working at all currently for us, so we did a fallback to GLX for Firefox in the past already I assume.
This explains why Chrome is not working as of now, as you mentioned that it only supports EGL with VirtualGL, whereas Firefox can switch to GLX.

VGL_LOGO=1 vglrun +tr -d egl google-chrome --use-gl=egl --disable-seccomp-filter-sandbox
[VGL 0xa8e46f80] XQueryExtension (dpy=0x2b100026e800(:1) name=GLX [VGL] ERROR: in queryExtension--
[VGL] 1055: The EGL back end requires a 2D X server with a GLX extension.
[16080:16080:0313/155125.313930:ERROR:gpu_process_host.cc(952)] GPU process exited unexpectedly: exit_code=256
[VGL] dlopen (filename=libva.so.2 flag=1 retval=0x00000000)
[16255:16255:0313/155125.323882:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is disabled, ANGLE is
[VGL] dlopen (filename=/opt/google/chrome/liboptimization_guide_internal.so flag=1 retval=0x262400e3b700)
[VGL] dlopen (filename=/opt/google/chrome/libvulkan.so.1 flag=2 retval=0x2b10002a5900)
[VGL] dlopen (filename=libVkLayer_MESA_device_select.so flag=1 retval=0x2b10002a6300)
[VGL] dlopen (filename=libVkLayer_MESA_device_select.so flag=1 retval=0x2b10002a6d00)
[VGL] dlopen (filename=libGLX_nvidia.so.0 flag=1 retval=0x2b10002a6300)
[VGL 0xa8e46f80] XOpenDisplay (name=NULL dpy=0x2b100026c000(:1) ) 73.529005 ms
[VGL 0xa8e46f80] XQueryExtension (dpy=0x2b100026c000(:1) name=GLX [VGL] ERROR: in queryExtension--
[VGL] 1055: The EGL back end requires a 2D X server with a GLX extension.

@dcommander
Copy link
Member

Ah, OK. It appears that your 2D X server doesn't have a GLX extension, which is why the EGL back end isn't working. When the EGL back end is emulating GLX, it needs to "borrow" the 2D X server's GLX extension in order to report GLX errors properly (since there is no 3D X server GLX extension for it to use.) However, EGL/X11 doesn't need to report GLX errors, so I'll see if I can make that a non-fatal error, which should allow Chrome to work in your environment. I should be able to reproduce your environment by disabling the GLX extension in TurboVNC.

dcommander added a commit that referenced this issue Mar 14, 2023
Some applications, including Chrome/Chromium, support both EGL/X11 and
GLX, so the EGL back end shouldn't throw a fatal error if those
applications call XQueryExtension(..., "GLX", ...) or
glXQueryExtension() and the 2D X server doesn't have a GLX extension.
Instead, the EGL back end now throws a fatal error only if it actually
needs to use the 2D X server's GLX extension to handle a GLX error.

Fixes one of the complaints in #228
@dcommander
Copy link
Member

@langeschro The latest pre-release build should now allow Chrome/Chromium to work properly even if the 2D X server doesn't have a GLX extension. The EGL back end needs the 2D X server's GLX extension in order to properly implement GLX error handling, so XQueryExtension(..., "GLX", ...) and glXQueryExtension() now return False, rather than throwing a fatal error, if the 2D X server doesn't have a GLX extension. However, the application will still work as long as it doesn't try to do anything that throws a GLX error.

@langeschro
Copy link
Author

Hi @dcommander I've tested the latest build and seem to be getting the same error message as before.

Command line:
VGL_LOGO=1 vglrun +tr -d egl google-chrome --e-gl=egl --disable-seccomp-filter-sandbox

[VGL 0xcb9bcf80] XOpenDisplay (name=NULL dpy=0x3edc0026e800(:1) ) 0.508070 ms
[VGL 0xcb9bcf80] XQueryExtension (dpy=0x3edc0026e800(:1) name=GLX [VGL] ERROR: in queryExtension--
[VGL] 1055: The EGL back end requires a 2D X server with a GLX extension.
[10180:10180:0315/101146.544151:ERROR:gpu_process_host.cc(952)] GPU process exited unexpectedly: exit_code=256
[VGL] dlopen (filename=libva.so.2 flag=1 retval=0x00000000)
[10440:10440:0315/101146.666862:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is disabled, ANGLE is
[VGL] dlopen (filename=/opt/google/chrome/liboptimization_guide_internal.so flag=1 retval=0x385c03761100)

Also tried without "--e-gl=egl" but I am receiving the same error message.
Any other parameters I should try instead?

@dcommander
Copy link
Member

There is no way that the latest build can generate that error message in the body of XQueryExtension(), and you can see that for yourself in the code: 65061e8. You must not be testing the latest build. I just tried it myself on a TurboVNC session started without a GLX extension, and it works for me.

@langeschro
Copy link
Author

Hi @dcommander no idea what went wrong there, I definitely had the correct package installed, maybe some weird caching that was going on.
I've retried now with Chrome (110.0.5481.100 64bit) and VirtualGL-3.0.91-20230314.x86_64.

Partial success
Command line: VGL_LOGO=1 vglrun +tr -d egl google-chrome --e-gl=egl --disable-seccomp-filter-sandbox
No VGL logo but got a spinning cube now

Graphics Feature Status
Canvas: Hardware accelerated
Canvas out-of-process rasterization: Disabled
Direct Rendering Display Compositor: Disabled
Compositing: Software only. Hardware acceleration disabled
Multiple Raster Threads: Disabled
OpenGL: Enabled
Rasterization: Hardware accelerated
Raw Draw: Disabled
Video Decode: Hardware accelerated
Video Encode: Software only. Hardware acceleration disabled
Vulkan: Disabled
WebGL: Hardware accelerated but at reduced performance
WebGL2: Hardware accelerated but at reduced performance
WebGPU: Disabled

The "disable-seccomp-filter-sandbox" option does not seem to be required for me either.
Getting the same results without it.
Also same result when removing "--e-gl=egl" from the options.

Please let me know if this is the result you would expect and if I should provide any further information.

Thanks a lot for your quick help, highly appreciated.

@dcommander
Copy link
Member

It should be --use-gl=egl, not --e-gl=egl. I spent hours describing in #228 (comment) exactly the results I would expect. As you can see, the result you got is the same result I got when I eliminated --use-gl=egl from the command line. That's because you mistyped that option.

@langeschro
Copy link
Author

Oh, that's really embarrassing, there must have gone something wrong in my notepad when copy/pasting.
I am so sorry about this, didn't want to waste your time there!

Retried now using "VGL_LOGO=1 vglrun +tr -d egl google-chrome --use-gl=egl --disable-seccomp-filter-sandbox"

Partial success
VGL logo displayed, spinning cube

For some reason Multiple Raster Threads is "disabled" in my case, you mentioned that this should be enabled for a "success".
All of the other options seem to be correct now.

Canvas: Hardware accelerated
Canvas out-of-process rasterization: Disabled
Direct Rendering Display Compositor: Disabled
Compositing: Hardware accelerated
Multiple Raster Threads: Disabled
OpenGL: Enabled
Rasterization: Hardware accelerated
Raw Draw: Disabled
Video Decode: Hardware accelerated
Video Encode: Software only. Hardware acceleration disabled
Vulkan: Disabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
WebGPU: Disabled

Also "--disable-seccomp-filter-sandbox" is now required when using "--use-gl=egl"

@dcommander
Copy link
Member

OK, great. I'm not sure why, but sometimes Chrome disables multiple raster threads with certain GPUs. I don't observe that with my Quadro P620, 525.xx, and Rocky Linux 8.7, but maybe it is specific to the T4. Chrome might do the same thing when you run it on the local display without VirtualGL, but I wouldn't worry about it either way.

dcommander added a commit that referenced this issue Feb 21, 2024
Since the beginning, VirtualGL has cleared new "virtual window" Pbuffers
(Pbuffers that it creates to emulate OpenGL windows) when the Pbuffers
are made current for the first time.  Unlike new X windows, the contents
of new Pbuffers are undefined, and "back in the day", some OpenGL
implementations did not clear new Pbuffers.  Applications were
particularly economical with their 3D rendering back then, and some of
them relied on the fact that new X windows start out blank.  Thus,
VirtualGL had to clear new virtual window Pbuffers, particularly ones
that it created in midstream (in response to a window resize that
occurred between glXSwapBuffers() or glXMakeCurrent() calls.)  Since the
Pbuffer clearing code was introduced before VirtualGL was open sourced,
information about the specific OpenGL implementations and 3D
applications that necessitated it has been lost to history.  Clearing
new virtual window Pbuffers is likely never necessary in 2024, and it
definitely isn't necessary unless the default framebuffer is bound to
the GL_DRAW_FRAMEBUFFER target.  (FBOs weren't a thing "back in the
day.")

VirtualGL handles midstream window resizes in the body of glViewport(),
but because FBOs and their bindings are attached to a specific context
rather than a specific drawable, the first glViewport() call that a 3D
application makes after its window is resized might be made while an FBO
is bound to the GL_DRAW_FRAMEBUFFER target.  That is the case with
Firefox, so VirtualGL's attempt to clear the new virtual window Pbuffer
that it created in the body of glViewport() cleared part of an FBO
instead, resulting in the disappearance of random characters or other
elements of the Firefox window.

Modern OpenGL implementations seem to clear new Pbuffers, at least in my
limited testing, so we could probably get away with jettisoning the
Pbuffer clearing code altogether.  However, the minimally invasive fix
is simply to forego clearing a new virtual window Pbuffer if an FBO is
bound to the GL_DRAW_FRAMEBUFFER target.

Note that this appears to have been the "update issue" that I observed
in certain versions of Firefox and documented in
#228 (comment)
In fact, the issue was always reproducible with either back end.  I
didn't always observe it because it didn't always occur unless you
resized the Firefox window repeatedly, and it was more likely to occur
with the GLX back end than with the EGL back end.
dcommander added a commit that referenced this issue Feb 21, 2024
Since the beginning, VirtualGL has cleared new "virtual window" Pbuffers
(Pbuffers that it creates to emulate OpenGL windows) when the Pbuffers
are made current for the first time.  Unlike new X windows, the contents
of new Pbuffers are undefined, and "back in the day", some OpenGL
implementations did not clear new Pbuffers.  Applications were
particularly economical with their 3D rendering back then, and some of
them relied on the fact that new X windows start out blank.  Thus,
VirtualGL had to clear new virtual window Pbuffers, particularly ones
that it created in midstream (in response to a window resize that
occurred between glXSwapBuffers() or glXMakeCurrent() calls.)  Since the
Pbuffer clearing code was introduced before VirtualGL was open sourced,
information about the specific OpenGL implementations and 3D
applications that necessitated it has been lost to history.  Clearing
new virtual window Pbuffers is likely never necessary in 2024, and it
definitely isn't necessary unless the default framebuffer is bound to
the GL_DRAW_FRAMEBUFFER target.  (FBOs weren't a thing "back in the
day.")

VirtualGL handles midstream window resizes in the body of glViewport(),
but because FBOs and their bindings are attached to a specific context
rather than a specific drawable, the first glViewport() call that a 3D
application makes after its window is resized might be made while an FBO
is bound to the GL_DRAW_FRAMEBUFFER target.  That is the case with
Firefox, so VirtualGL's attempt to clear the new virtual window Pbuffer
that it created in the body of glViewport() cleared part of an FBO
instead, resulting in the disappearance of random characters or other
elements of the Firefox window.

Modern OpenGL implementations seem to clear new Pbuffers, at least in my
limited testing, so we could probably get away with jettisoning the
Pbuffer clearing code altogether.  However, the minimally invasive fix
is simply to forego clearing a new virtual window Pbuffer if an FBO is
bound to the GL_DRAW_FRAMEBUFFER target.

Note that this appears to have been the "update issue" that I observed
in certain versions of Firefox and documented in
#228 (comment)
In fact, the issue was always reproducible with either back end.  I
didn't always observe it because it didn't always occur unless you
resized the Firefox window repeatedly, and it was more likely to occur
with the GLX back end than with the EGL back end.
dcommander added a commit that referenced this issue Feb 21, 2024
Since the beginning, VirtualGL has cleared new "virtual window" Pbuffers
(Pbuffers that it creates to emulate OpenGL windows) when the Pbuffers
are made current for the first time.  Unlike new X windows, the contents
of new Pbuffers are undefined, and "back in the day", some OpenGL
implementations did not clear new Pbuffers.  Applications were
particularly economical with their 3D rendering back then, and some of
them relied on the fact that new X windows start out blank.  Thus,
VirtualGL had to clear new virtual window Pbuffers, particularly ones
that it created in midstream (in response to a window resize that
occurred between glXSwapBuffers() or glXMakeCurrent() calls.)  Since the
Pbuffer clearing code was introduced before VirtualGL was open sourced,
information about the specific OpenGL implementations and 3D
applications that necessitated it has been lost to history.  Clearing
new virtual window Pbuffers is likely never necessary in 2024, and it
definitely isn't necessary unless the default framebuffer is bound to
the GL_DRAW_FRAMEBUFFER target.  (FBOs weren't a thing "back in the
day.")

VirtualGL handles midstream window resizes in the body of glViewport(),
but because FBOs and their bindings are attached to a specific context
rather than a specific drawable, the first glViewport() call that a 3D
application makes after its window is resized might be made while an FBO
is bound to the GL_DRAW_FRAMEBUFFER target.  That is the case with
Firefox, so VirtualGL's attempt to clear the new virtual window Pbuffer
that it created in the body of glViewport() cleared part of an FBO
instead, resulting in the disappearance of random characters or other
elements of the Firefox window.

Modern OpenGL implementations seem to clear new Pbuffers, at least in my
limited testing, so we could probably get away with jettisoning the
Pbuffer clearing code altogether.  However, the minimally invasive fix
is simply to forego clearing a new virtual window Pbuffer if an FBO is
bound to the GL_DRAW_FRAMEBUFFER target.

Note that this appears to have been the "update issue" that I observed
in certain versions of Firefox and documented in
#228 (comment)
In fact, the issue was always reproducible with either back end.  I
didn't always observe it because it didn't always occur unless you
resized the Firefox window repeatedly, and it was more likely to occur
with the GLX back end than with the EGL back end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants