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

Problems with egl rendering #415

Open
ambitious-octopus opened this issue Jul 19, 2023 · 2 comments
Open

Problems with egl rendering #415

ambitious-octopus opened this issue Jul 19, 2023 · 2 comments

Comments

@ambitious-octopus
Copy link

I am working on a mujoco simulation inside a docker container (using nvidia-docker for GPU access). My simulation use egl for hardware rendering and on my local machine works perfectly. I would like to run my simulation on a server with 3 NVIDIA A40.
When I run this script in the same docker image but on the server

import os
os.environ["MUJOCO_GL"]="egl"
os.environ["MUJOCO_EGL_DEVICE_ID"] = "1"
from dm_control import mujoco

I get this error:

ImportError: Cannot initialize a headless EGL display.

Server:
Nvidia Driver Version: 525.85.12 CUDA Version: 12.0

Local Machine:
Nvidia Driver Version: 525.116.04 CUDA Version: 12.0

If I use osmesa (os.environ["MUJOCO_GL"]="egl") everything works correctly. But I would like to use egl.
I tried to install libnvidia-gl (apt install libnvidia-gl-525) as in #214 and #365. but I get the same error.

I should also add that I do not use NVIDIA Multi-Instance GPU.
Am I doing something wrong here?
Thank you in advance for the support!

@saran-t
Copy link
Member

saran-t commented Jul 19, 2023

This almost definitely means that your Docker container doesn't have permission to access the GPU hardware specified.

Have you tried setting MUJOCO_EGL_DEVICE_ID to 0 ?

@ambitious-octopus
Copy link
Author

ambitious-octopus commented Jul 19, 2023

I suspected that. It works with MUJOCO_EGL_DEVICE_ID=0.
I would also add that nvidia-smi within the container shows all the gpu's.
And I'm still not using the GPU! What am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants