Offscreen rendering with mjr_render is extremely slow #2222
Unanswered
michaelala25
asked this question in
Asking for Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Intro
Hi!
I am a graduate student using mujoco for research into ML for robotics.
My setup
I'm using MuJoCo version 3.2.1, Python version 3.10.14, Ubuntu 22.04.4 LTS with libglfw3-dev 3.3.6-1. Output of
glxinfo | grep "OpenGL version"
isOpenGL version string: 4.6 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
.My question
I'm posting this question because I'm not really sure how to proceed into investigating this issue and I'd like some help. I'm trying to render both to a window and offscreen simultaneously, and for some reason offscreen rendering takes astronomically longer. I'd like to render at around 20Hz and a single call to render offscreen is taking >50ms right now, with the culprit being
mjr_render
andmjr_readPixels
.Below is the output of
cProfile.run
on myenv.render()
call:Notice that the calls to
mjr_render
andmjr_overlay
take <1ms here.Below is the output of
cProfile.run
on mycamera.render()
call (offscreen rendering):Now for some reason
mjr_render
is taking 12ms andmjr_readPixels
is taking a whopping 55ms. This is at an offscreen viewport resolution set to 1920 x 1080 but curiously even with a viewport resolution of 64 x 64, themjr_readPixels
call takes 30ms, so it appears the bottleneck doesn't have to do too much with resolution. Additionally I'd like to cautiously add that the profiler output indicates the issue is isolated to solely mujoco calls, and doesn't appear to have anything to do with my code (though perhaps I simply haven't spotted it yet).Frankly I'm at a loss for how to even investigate this further, as GLFW and rendering in general isn't really my area of expertise. One thing I know is that GLFW is the only OpenGL interface that seems to work on my system (neither EGL nor osmesa seem to work). I'm not even sure how that piece of information would be relevant but, figured I'd include it.
What should I do next to investigate the source of this problem?
Minimal model and/or code that explain my question
No response
Confirmations
Beta Was this translation helpful? Give feedback.
All reactions