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

egl backend: FPS limitation no longer works after commit 21cc496 #244

Closed
coin0 opened this issue Dec 26, 2023 · 4 comments
Closed

egl backend: FPS limitation no longer works after commit 21cc496 #244

coin0 opened this issue Dec 26, 2023 · 4 comments

Comments

@coin0
Copy link

coin0 commented Dec 26, 2023

I tested commit 21cc496 and found before that commit with EGL backend fps could be constrained by VGL_FPS option but after that commit limitation for the rendering fps will no longer be effective. Please notice that I enabled frame spoil.

Try with chrome browser version < M106 and open webgl test link: https://webglsamples.org/aquarium/aquarium.html

Example: start chrome with vglrun:

VGL_REFRESHRATE=15 VGL_FPS=15 DISPLAY=:99 vglrun -d /dev/dri/card1 -fps 15 +sp /usr/bin/chrome --use-gl=egl --disable-seccomp-filter-sandbox https://webglsamples.org/aquarium/aquarium.html

@dcommander
Copy link
Member

I suspect the problem is that Chrome is no longer accelerated by VirtualGL at all. See #229

@dcommander
Copy link
Member

Also note: VGL_REFRESHRATE is not a legitimate setting.

@coin0
Copy link
Author

coin0 commented Dec 27, 2023

I hardcoded fps in the function eglSwapBuffers() from faker-egl.cpp and it now works with frame spoil enabled.
But I suspect there still be a problem somewhere when read back rendered frames from gpu because if I limit fps to 15 and encode frames into a video file it looks frozen from time to time. And it works perfect on version 3.0.2.

@dcommander
Copy link
Member

I cannot reproduce any of your claims. I tested VGL_FPS with /opt/VirtualGL/bin/eglxspheres64 (which uses EGL/X11), and it works as expected. Please note that, by default, VGL_FPS limits the transport frame rate, not the 3D rendering frame rate. If you want VGL_FPS to also limit the 3D rendering frame rate, then you need to disable frame spoiling by setting VGL_SPOIL to 0 or passing -sp to vglrun. I also tested with Chrome v104 and observe the same thing. The problem seems to be that you are expecting the WebGL benchmark to reflect the frame rate limit from VGL_FPS, but it will never do that unless you disable frame spoiling in VirtualGL. (Note also that frame spoiling is enabled by default, so it isn't necessary to pass +sp to vglrun.) With frame spoiling enabled, VGL_FPS will govern the end-to-end frame rate (the frame rate that the user actually observes while interacting with a 3D application) but not the 3D rendering frame rate. Thus, the WebGL benchmark (which reflects only the 3D rendering frame rate) will not appear to be affected by VGL_FPS. However, you can use tcbench (in the VirtualGL source) to verify that the frame rate of the application is being limited to 15. Section 17.2 in the VirtualGL User's Guide mentions the need to disable frame spoiling when using VirtualGL with non-interactive OpenGL applications, including benchmarks.

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