Genesis icon indicating copy to clipboard operation
Genesis copied to clipboard

我是在一个gpu平台上租的显卡,现在的问题是检测不到显示屏,有什么办法解决吗

Open wozwdaqian opened this issue 11 months ago • 10 comments
trafficstars

在优云智算上租的显卡,但是他实际上是给我一个docker容器使用,安装运行示例代码会出现下面的问题

(Genesis) root@ca23621e2d9c:/workspace/Genesis# python test.py
[Genesis] [10:22:31] [INFO] ╭─────────────────────────────────────────────────────────────────────────────────────╮
[Genesis] [10:22:31] [INFO] │┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉ Genesis ┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉│
[Genesis] [10:22:31] [INFO] ╰─────────────────────────────────────────────────────────────────────────────────────╯
[Genesis] [10:22:32] [INFO] Running on [NVIDIA GeForce RTX 4090] with backend gs.cuda. Device memory: 23.64 GB.
[Genesis] [10:22:32] [INFO] 🚀 Genesis initialized. 🔖 version: 0.2.0, 🌱 seed: None, 📏 precision: '32', 🐛 debug: False, 🎨 theme: 'dark'.
[Genesis] [10:22:33] [INFO] Scene <d8ddbcd> created.
[Genesis] [10:22:33] [INFO] Building scene <d8ddbcd>...
[Genesis] [10:22:33] [INFO] Compiling simulation kernels...
[Genesis] [10:22:33] [INFO] Building visualizer...
Traceback (most recent call last):
  File "/workspace/Genesis/test.py", line 13, in <module>
    scene.build()
  File "/workspace/Genesis/genesis/utils/misc.py", line 38, in wrapper
    return method(self, *args, **kwargs)
  File "/workspace/Genesis/genesis/engine/scene.py", line 565, in build
    self._visualizer.build()
  File "/workspace/Genesis/genesis/vis/visualizer.py", line 110, in build
    self._rasterizer.build()
  File "/workspace/Genesis/genesis/vis/rasterizer.py", line 31, in build
    self._renderer = pyrender.OffscreenRenderer(
  File "/workspace/Genesis/genesis/ext/pyrender/offscreen.py", line 29, in __init__
    self._create(pyopengl_platform)
  File "/workspace/Genesis/genesis/ext/pyrender/offscreen.py", line 193, in _create
    self._platform.init_context()
  File "/workspace/Genesis/genesis/ext/pyrender/platforms/egl.py", line 205, in init_context
    assert eglInitialize(self._egl_display, major, minor)
  File "/root/miniconda3/envs/Genesis/lib/python3.9/site-packages/OpenGL/platform/baseplatform.py", line 415, in __call__
    return self( *args, **named )
  File "/root/miniconda3/envs/Genesis/lib/python3.9/site-packages/OpenGL/error.py", line 230, in glCheckError
    raise self._errorClass(
OpenGL.raw.EGL._errors.EGLError: EGLError(
	err = EGL_NOT_INITIALIZED,
	baseOperation = eglInitialize,
	cArguments = (
		<OpenGL._opaque.EGLDisplay_pointer object at 0x7f33c80a48c0>,
		c_long(0),
		c_long(0),
	),
	result = 0
)

下面是我的代码

import genesis as gs
gs.init(backend=gs.gpu)

scene = gs.Scene(show_viewer=False)
cam = scene.add_camera(
    res    = (1280, 960),
    pos    = (3.5, 0.0, 2.5),
    lookat = (0, 0, 0.5),
    fov    = 30,
    GUI    = False
)

scene.build()

# render rgb, depth, segmentation mask and normal map
rgb, depth, segmentation, normal = cam.render(depth=True, segmentation=True, normal=True)

# start camera recording. Once this is started, all the rgb images rendered will be recorded internally
cam.start_recording()

import numpy as np
for i in range(120):
    scene.step()

    # change camera position
    cam.set_pose(
        pos    = (3.0 * np.sin(i / 60), 3.0 * np.cos(i / 60), 2.5),
        lookat = (0, 0, 0.5),
    )
    
    cam.render()

# stop recording and save video. If `filename` is not specified, a name will be auto-generated using the caller file name.
cam.stop_recording(save_to_filename='video.mp4', fps=60)

下面是运行glxinfo | grep "OpenGL"的输出

OpenGL vendor string: Mesa
OpenGL renderer string: llvmpipe (LLVM 15.0.7, 256 bits)
OpenGL version string: 4.5 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.3
OpenGL shading language version string: 4.50
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:

wozwdaqian avatar Dec 23 '24 02:12 wozwdaqian