Skip to content

Commit 4b68286

Browse files
Merge branch 'ccrouzet/gh-344-cpu-only-renderer' into 'main'
Allow the OpenGL Renderer to Run Without CUDA Closes GH-344 See merge request omniverse/warp!925
2 parents bfed332 + af49454 commit 4b68286

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
`wp.atomic_max()`, or `wp.atomic_min()` as being written to ([GH-378](https://github.com/NVIDIA/warp/issues/378)).
2525
- Fix for occasional failure to update .meta files into Warp kernel cache on Windows
2626
- Mark kernel arrays as written to when passed to `wp.atomic_add()` or `wp.atomic_sub()`
27+
- Fix the OpenGL renderer not being able to run without CUDA ([GH-344](https://github.com/NVIDIA/warp/issues/344)).
2728

2829
## [1.5.0] - 2024-12-02
2930

warp/render/render_opengl.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ def __init__(
968968
enable_backface_culling=True,
969969
enable_mouse_interaction=True,
970970
enable_keyboard_interaction=True,
971+
device=None,
971972
):
972973
"""
973974
Args:
@@ -997,6 +998,7 @@ def __init__(
997998
enable_backface_culling (bool): Whether to enable backface culling.
998999
enable_mouse_interaction (bool): Whether to enable mouse interaction.
9991000
enable_keyboard_interaction (bool): Whether to enable keyboard interaction.
1001+
device (Devicelike): Where to store the internal data.
10001002
10011003
Note:
10021004
@@ -1040,7 +1042,11 @@ def __init__(
10401042
self.render_depth = render_depth
10411043
self.enable_backface_culling = enable_backface_culling
10421044

1043-
self._device = wp.get_cuda_device()
1045+
if device is None:
1046+
self._device = wp.get_preferred_device()
1047+
else:
1048+
self._device = wp.get_device(device)
1049+
10441050
self._title = title
10451051

10461052
self.window = pyglet.window.Window(

0 commit comments

Comments
 (0)