Spaces:
Runtime error
Runtime error
brjathu
commited on
Commit
•
f5397b2
1
Parent(s):
968464c
Adding HF files
Browse files- app.py +0 -3
- vendor/pyrender/pyrender/offscreen.py +9 -9
app.py
CHANGED
@@ -1,6 +1,3 @@
|
|
1 |
-
import os
|
2 |
-
os.environ["PYOPENGL_PLATFORM"] = "osmesa"
|
3 |
-
|
4 |
import argparse
|
5 |
import os
|
6 |
from pathlib import Path
|
|
|
|
|
|
|
|
|
1 |
import argparse
|
2 |
import os
|
3 |
from pathlib import Path
|
vendor/pyrender/pyrender/offscreen.py
CHANGED
@@ -134,16 +134,16 @@ class OffscreenRenderer(object):
|
|
134 |
# self.viewport_height)
|
135 |
# if 'PYOPENGL_PLATFORM' not in os.environ:
|
136 |
# elif os.environ['PYOPENGL_PLATFORM'] == 'egl':
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
# elif os.environ['PYOPENGL_PLATFORM'] == 'osmesa':
|
144 |
-
from pyrender.platforms.osmesa import OSMesaPlatform
|
145 |
-
self._platform = OSMesaPlatform(self.viewport_width,
|
146 |
-
|
147 |
# else:
|
148 |
# raise ValueError('Unsupported PyOpenGL platform: {}'.format(
|
149 |
# os.environ['PYOPENGL_PLATFORM']
|
|
|
134 |
# self.viewport_height)
|
135 |
# if 'PYOPENGL_PLATFORM' not in os.environ:
|
136 |
# elif os.environ['PYOPENGL_PLATFORM'] == 'egl':
|
137 |
+
from pyrender.platforms import egl
|
138 |
+
device_id = int(os.environ.get('EGL_DEVICE_ID', '0'))
|
139 |
+
egl_device = egl.get_device_by_index(device_id)
|
140 |
+
self._platform = egl.EGLPlatform(self.viewport_width,
|
141 |
+
self.viewport_height,
|
142 |
+
device=egl_device)
|
143 |
# elif os.environ['PYOPENGL_PLATFORM'] == 'osmesa':
|
144 |
+
# from pyrender.platforms.osmesa import OSMesaPlatform
|
145 |
+
# self._platform = OSMesaPlatform(self.viewport_width,
|
146 |
+
# self.viewport_height)
|
147 |
# else:
|
148 |
# raise ValueError('Unsupported PyOpenGL platform: {}'.format(
|
149 |
# os.environ['PYOPENGL_PLATFORM']
|