metadriverse / metadrive

MetaDrive: Open-source driving simulator
https://metadriverse.github.io/metadrive/
Apache License 2.0
746 stars 107 forks source link

Headless rendering: extracted image is colorless running in Docker container #721

Closed bongbui321 closed 4 months ago

bongbui321 commented 4 months ago

I'm currently running Metadrive in a Docker container and it seems that the image extracted from "rgb_camera" is all white (image below) image

It runs fine on host machine (having colors and textures are correct). I have confirmed that textures and shaders are loaded (paths to assets are correct), but unsure why it is like the image above. I extracted the images from rgb_camera.perceive()

Are there veryfying steps that I can make to make sure that the textures and shaders are loaded correctly?

Ah, I just narrowed down the issue to having no physical monitor or display port. The no-color display in the above image is from me initializing a virtual screen in xvfb first then run Metarive, but when I allow forwarding display from docker container to my host, every works fine. I wonder why?

Further narrowed it down to I think xvfb isn't utilizing Opengl to render. Not sure if OpenGL version string: 3.1 Mesa 21.2.6 is compatible with Metadrive

bongbui321 commented 4 months ago

My bad, this problem should have been solved, I was using Metadrive 4.2.3

zhangqf2001 commented 3 months ago

I also encountered this problem, can I ask how you solved it?