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

avoid trimesh import failure when pyrender has issue #327

Closed
wants to merge 1 commit into from

Conversation

Kashu7100
Copy link
Collaborator

  • Separated the trimesh import from pyrender

Avoid failure case like following:

[Error]: couldn't connect to display ""

Failed to import pyrender. Rendering will not work.
[Genesis] [08:48:54] [INFO] ╭─────────────────────────────────────────────────────────────────────────────────────╮
[Genesis] [08:48:54] [INFO] │┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉ Genesis ┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉│
[Genesis] [08:48:54] [INFO] ╰─────────────────────────────────────────────────────────────────────────────────────╯
[Genesis] [08:48:54] [INFO] Running on [NVIDIA GeForce RTX 3090] with backend gs.cuda. Device memory: 23.69 GB.
[Genesis] [08:48:54] [DEBUG] [Taichi] version 1.7.2, llvm 15.0.4, commit 0131dce9, linux, python 3.11.10
[Genesis] [08:48:54] [DEBUG] [Taichi] Starting on arch=cuda
[Genesis] [08:48:54] [INFO] 🚀 Genesis initialized. 🔖 version: 0.2.0, 🌱 seed: None, 📏 precision: '32', 🐛 debug: False, 🎨 theme: 'dark'.
Traceback (most recent call last):
  File "/workspace/examples/elastic_dragon.py", line 58, in <module>
    main()
  File "/workspace/examples/elastic_dragon.py", line 19, in main
    scene = gs.Scene(
            ^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/genesis/utils/misc.py", line 27, in new_init
    original_init(self, *args, **kwargs)
  File "/opt/conda/lib/python3.11/site-packages/genesis/engine/scene.py", line 148, in __init__
    self._visualizer = Visualizer(
                       ^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/genesis/vis/visualizer.py", line 26, in __init__
    self._context = RasterizerContext(vis_options)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/genesis/vis/rasterizer_context.py", line 37, in __init__
    self.init_meshes()
  File "/opt/conda/lib/python3.11/site-packages/genesis/vis/rasterizer_context.py", line 52, in init_meshes
    self.link_frame_mesh = trimesh.creation.axis(origin_size=0.03, axis_radius=0.025, axis_length=1.0)
                           ^^^^^^^
NameError: name 'trimesh' is not defined
[Genesis] [08:48:55] [INFO] 💤 Exiting Genesis and caching compiled kernels...

@zhouxian
Copy link
Collaborator

already fixed in latest commit :)

@zhouxian zhouxian closed this Dec 26, 2024
@JosvanderWesthuizen
Copy link

JosvanderWesthuizen commented Dec 27, 2024

I'm still getting the same error even though I'm installing locally from the latest version of Genesis?

(genesis) josvanderwesthuizen@mac Genesis % gs view /Users/josvanderwesthuizen/coplay_repos/coplay/Backend/coplay/test_data/CuteCat.fbx
objc[29176]: Class GLFWHelper is implemented in both /Users/josvanderwesthuizen/miniconda3/envs/genesis/lib/python3.12/site-packages/taichi/_lib/core/taichi_python.cpython-312-darwin.so (0x143af8570) and /Users/josvanderwesthuizen/miniconda3/envs/genesis/lib/python3.12/site-packages/pygel3d/libPyGEL.dylib (0x32350d7c0). One of the two will be used. Which one is undefined.
objc[29176]: Class GLFWApplicationDelegate is implemented in both /Users/josvanderwesthuizen/miniconda3/envs/genesis/lib/python3.12/site-packages/taichi/_lib/core/taichi_python.cpython-312-darwin.so (0x143af85c0) and /Users/josvanderwesthuizen/miniconda3/envs/genesis/lib/python3.12/site-packages/pygel3d/libPyGEL.dylib (0x32350d810). One of the two will be used. Which one is undefined.
objc[29176]: Class GLFWWindowDelegate is implemented in both /Users/josvanderwesthuizen/miniconda3/envs/genesis/lib/python3.12/site-packages/taichi/_lib/core/taichi_python.cpython-312-darwin.so (0x143af85e8) and /Users/josvanderwesthuizen/miniconda3/envs/genesis/lib/python3.12/site-packages/pygel3d/libPyGEL.dylib (0x32350d838). One of the two will be used. Which one is undefined.
objc[29176]: Class GLFWContentView is implemented in both /Users/josvanderwesthuizen/miniconda3/envs/genesis/lib/python3.12/site-packages/taichi/_lib/core/taichi_python.cpython-312-darwin.so (0x143af8638) and /Users/josvanderwesthuizen/miniconda3/envs/genesis/lib/python3.12/site-packages/pygel3d/libPyGEL.dylib (0x32350d888). One of the two will be used. Which one is undefined.
objc[29176]: Class GLFWWindow is implemented in both /Users/josvanderwesthuizen/miniconda3/envs/genesis/lib/python3.12/site-packages/taichi/_lib/core/taichi_python.cpython-312-darwin.so (0x143af86b0) and /Users/josvanderwesthuizen/miniconda3/envs/genesis/lib/python3.12/site-packages/pygel3d/libPyGEL.dylib (0x32350d900). One of the two will be used. Which one is undefined.
[Error]: No ffmpeg exe could be found. Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable.

Failed to import pyrender. Rendering will not work.
[Genesis] [13:37:53] [INFO] ╭───────────────────────────────────────────────╮
[Genesis] [13:37:53] [INFO] │┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈ Genesis ┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈│
[Genesis] [13:37:53] [INFO] ╰───────────────────────────────────────────────╯
[Genesis] [13:37:53] [INFO] Running on [Apple M4 Max] with backend gs.cpu. Device memory: 128.00 GB.
[Genesis] [13:37:53] [INFO] 🚀 Genesis initialized. 🔖 version: 0.2.0, 🌱 seed: None, 📏 precision: '32', 🐛 debug: False, 🎨 theme: 'dark'.
Traceback (most recent call last):
  File "/Users/josvanderwesthuizen/miniconda3/envs/genesis/bin/gs", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/josvanderwesthuizen/coplay_repos/Genesis/genesis/_main.py", line 252, in main
    view(args.filename, args.collision, args.rotate, args.scale)
  File "/Users/josvanderwesthuizen/coplay_repos/Genesis/genesis/_main.py", line 113, in view
    scene = gs.Scene(
            ^^^^^^^^^
  File "/Users/josvanderwesthuizen/coplay_repos/Genesis/genesis/utils/misc.py", line 27, in new_init
    original_init(self, *args, **kwargs)
  File "/Users/josvanderwesthuizen/coplay_repos/Genesis/genesis/engine/scene.py", line 148, in __init__
    self._visualizer = Visualizer(
                       ^^^^^^^^^^^
  File "/Users/josvanderwesthuizen/coplay_repos/Genesis/genesis/vis/visualizer.py", line 26, in __init__
    self._context = RasterizerContext(vis_options)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/josvanderwesthuizen/coplay_repos/Genesis/genesis/vis/rasterizer_context.py", line 37, in __init__
    self.init_meshes()
  File "/Users/josvanderwesthuizen/coplay_repos/Genesis/genesis/vis/rasterizer_context.py", line 52, in init_meshes
    self.link_frame_mesh = trimesh.creation.axis(origin_size=0.03, axis_radius=0.025, axis_length=1.0)
                           ^^^^^^^
NameError: name 'trimesh' is not defined
[Genesis] [13:37:53] [INFO] 💤 Exiting Genesis and caching compiled kernels...

UPDATE: installing ffmpeg fixed this. (but .fbx is not supported yet)

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

Successfully merging this pull request may close these issues.

3 participants