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

[BUG] OpenGLRenderer Requires CUDA #344

Open
Sina-Haz opened this issue Nov 6, 2024 · 0 comments
Open

[BUG] OpenGLRenderer Requires CUDA #344

Sina-Haz opened this issue Nov 6, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Sina-Haz
Copy link

Sina-Haz commented Nov 6, 2024

Bug Description

I am trying to render my simulation with OpenGL but when I try to create the renderer object I get an error saying that 'cuda' is requested. Why can I not specify that the simulation should run with cpu? There is no device keyword argument, I also tried running the code with wp.ScopedDevice('cpu') and got the same error.

Here is the code snippet:

Let this class represent the spring-rod system

class System:
def init(self, stage_path="spring_rod.usd"):
fps = 60
self.frame_dt = 1.0 / fps
self.sim_substeps = 5
self.sim_dt = self.frame_dt / self.sim_substeps
self.sim_time = 0.0

    builder = wps.ModelBuilder()
    wps.parse_mjcf(
        'single_rod_spring.xml',
        builder
    )

    self.model = builder.finalize()

    self.integrator = wps.SemiImplicitIntegrator()
    self.state0 = self.model.state()
    self.state1 = self.model.state()
    
    # Set up the renderer
    with wp.ScopedDevice('cpu'):
        self.renderer = wpr.SimRendererOpenGL(self.model, stage_path)

Here is the error:
self.renderer = wpr.SimRendererOpenGL(self.model, stage_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/warp/sim/render.py", line 79, in init
super().init(path, scaling=scaling, fps=fps, up_axis=up_axis, **render_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/warp/render/render_opengl.py", line 1039, in init
self._device = wp.get_cuda_device()
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/warp/context.py", line 3799, in get_cuda_device
return runtime.get_current_cuda_device()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/warp/context.py", line 3669, in get_current_cuda_device
raise RuntimeError('"cuda" device requested but this build of Warp does not support CUDA')
RuntimeError: "cuda" device requested but this build of Warp does not support CUDA

System Information

Running with warp-lang 1.4.1 on Python 3.11.6 with macOS

@Sina-Haz Sina-Haz added the bug Something isn't working label Nov 6, 2024
@christophercrouzet christophercrouzet self-assigned this Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants