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

Headless rendering on Mac? #464

Open
dghw opened this issue Apr 12, 2024 · 2 comments
Open

Headless rendering on Mac? #464

dghw opened this issue Apr 12, 2024 · 2 comments

Comments

@dghw
Copy link

dghw commented Apr 12, 2024

I'm currently trying to run something on a headless Mac server that is hanging due to a call to Physics.render()

Relevant code excerpt:

from dm_control.suite import base

class MyTask(base.Task):

  ...

  def get_observation(self, physics):
    image = physics.render(...)  
    ...

my_task.get_observation(self, physics)

I face the same issue if I try to follow the 'getting started' steps outlined here: https://github.com/google-deepmind/dm_control/tree/main/dm_control/mujoco

From a few existing issues and the description on the main readme.md, I can't quite tell if headless rendering on a MacOS system is supported or not - it seems like it might only be supported for Nvidia systems. If so, are there any known workarounds?

@yuvaltassa
Copy link
Collaborator

@kevinzakka you render on Mac, right? Any thoughts?

@saran-t
Copy link
Member

saran-t commented Apr 15, 2024

In theory the CGL code path allows an OpenGL context to be created without a window. In practice the call to create a CGL context hangs until a graphical login session for the current user is created. I don't believe this is actually documented anywhere (and the entire CGL API is marked deprecated by Apple several years ago).

I've spent several days in the past trying to figure out how to open a graphical login session via SSH but have come to a conclusion that this isn't possible (or at least not through any documented means).

For our CI server the "workaround" is to VNC into the login screen and log in to the CI user after each reboot. In other words, it doesn't work headlessly.

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

3 participants