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

examples/rendering/demo can see nothing #386

Open
zhangiser opened this issue Dec 29, 2024 · 8 comments
Open

examples/rendering/demo can see nothing #386

zhangiser opened this issue Dec 29, 2024 · 8 comments

Comments

@zhangiser
Copy link

I just installed LuisaRenderPy,and run examples/rendering/demo,there show a black window,but i can see nothing

(torch) root@zhangiser-pc:/usr/Genesis# /root/miniconda3/envs/torch/bin/python /usr/Genesis/examples/rendering/demo.py
[Genesis] [22:17:18] [INFO] ╭─────────────────────────────────────────────────────────────────────────────────────╮
[Genesis] [22:17:18] [INFO] │┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉ Genesis ┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉│
[Genesis] [22:17:18] [INFO] ╰─────────────────────────────────────────────────────────────────────────────────────╯
[Genesis] [22:17:20] [INFO] Running on [NVIDIA GeForce RTX 4080 Laptop GPU] with backend gs.cuda. Device memory: 11.99 GB.
[Genesis] [22:17:20] [DEBUG] [Taichi] version 1.7.2, llvm 15.0.4, commit 0131dce9, linux, python 3.9.21
[Genesis] [22:17:20] [DEBUG] [Taichi] Starting on arch=cuda
[Genesis] [22:17:20] [INFO] 🚀 Genesis initialized. 🔖 version: 0.2.0, 🌱 seed: 0, 📏 precision: '32', 🐛 debug: False, 🎨 theme: 'dark'.
[Genesis] [22:17:24] [INFO] Scene <358c738> created.
[Genesis] [22:17:24] [INFO] Adding <gs.RigidEntity>. idx: 0, uid: <5fa03d3>, morph: <gs.morphs.Plane>, material: <gs.materials.Rigid>.
[Genesis] [22:17:24] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 0.
[Genesis] [22:17:24] [INFO] Adding <gs.RigidEntity>. idx: 1, uid: <da43849>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [22:17:25] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 1.
[Genesis] [22:17:25] [INFO] Adding <gs.RigidEntity>. idx: 2, uid: <85c3f8e>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [22:17:25] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 2.
[Genesis] [22:17:25] [INFO] Adding <gs.RigidEntity>. idx: 3, uid: <b61704d>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [22:17:25] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 3.
[Genesis] [22:17:25] [INFO] Adding <gs.RigidEntity>. idx: 4, uid: <acc18d5>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [22:17:25] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 4.
[Genesis] [22:17:25] [INFO] Adding <gs.RigidEntity>. idx: 5, uid: <adbd61d>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [22:17:25] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 5.
[Genesis] [22:17:25] [INFO] Adding <gs.RigidEntity>. idx: 6, uid: <6968ca3>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [22:17:25] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 6.
[Genesis] [22:17:25] [INFO] Adding <gs.RigidEntity>. idx: 7, uid: <dc6c019>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [22:17:25] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 7.
[Genesis] [22:17:25] [INFO] Adding <gs.RigidEntity>. idx: 8, uid: <309d8a4>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/wooden_sphere_OBJ/wooden_sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [22:17:26] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 8.
[Genesis] [22:17:26] [INFO] Adding <gs.RigidEntity>. idx: 9, uid: <5a9c52b>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/wooden_sphere_OBJ/wooden_sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [22:17:27] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 9.
[Genesis] [22:17:27] [INFO] Building scene <358c738>...
[Genesis] [22:17:30] [INFO] Compiling simulation kernels...
[Genesis] [22:17:33] [INFO] Building visualizer...
Segmentation fault (core dumped)

image

@zhouxian
Copy link
Collaborator

could you provide more info? os version, wsl or native etc

is this a freshly installed conda env?

@coghks625
Copy link

#318
i have same problem

@zhangiser
Copy link
Author

could you provide more info? os version, wsl or native etc

is this a freshly installed conda env?

I'm used windows wsl ubuntu,and this is a new conda env
version info:

WSL:2
Ubuntu:22.04
CUDA:12.4
conda:24.11.1
Pytorch:2.5.1
Genesis:main

nvcc info:

(base) root@zhangiser-pc:~# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Mar_28_02:18:24_PDT_2024
Cuda compilation tools, release 12.4, V12.4.131
Build cuda_12.4.r12.4/compiler.34097967_0

nvidia-smi info:

(base) root@zhangiser-pc:~# nvidia-smi
Mon Dec 30 10:09:49 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.77.01              Driver Version: 566.36         CUDA Version: 12.7     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4080 ...    On  |   00000000:01:00.0 Off |                  N/A |
| N/A   46C    P0            593W /  155W |       0MiB /  12282MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

pytorch info:

(base) root@zhangiser-pc:~# conda activate torch
(torch) root@zhangiser-pc:~# python
Python 3.9.21 | packaged by conda-forge | (main, Dec  5 2024, 13:51:40)
[GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True

demo.py

import os
os.environ['PYOPENGL_PLATFORM'] = 'glx'
import torch
import importlib.util
import genesis as gs


def main():
    ########################## init ##########################
    gs.init(seed=0, precision="32", logging_level="debug")

    ########################## create a scene ##########################
    scene = gs.Scene(
        sim_options=gs.options.SimOptions(),
        viewer_options=gs.options.ViewerOptions(
            res=(1920, 1080),
            camera_pos=(8.5, 0.0, 4.5),
            camera_lookat=(3.0, 0.0, 0.5),
            camera_fov=50,
        ),
        rigid_options=gs.options.RigidOptions(enable_collision=False, gravity=(0, 0, 0)),
        renderer=gs.renderers.RayTracer(  # type: ignore
            env_surface=gs.surfaces.Emission(
                emissive_texture=gs.textures.ImageTexture(
                    image_path="textures/indoor_bright.png",
                ),
            ),
            env_radius=15.0,
            env_euler=(0, 0, 180),
            lights=[
                {"pos": (0.0, 0.0, 10.0), "radius": 3.0, "color": (15.0, 15.0, 15.0)},
            ],
        ),
    )

    ########################## materials ##########################

    ########################## entities ##########################
    # floor
    plane = scene.add_entity(
        morph=gs.morphs.Plane(
            pos=(0.0, 0.0, -0.5),
        ),
        surface=gs.surfaces.Aluminium(
            ior=10.0,
        ),
    )

    # user specified external color texture
    scene.add_entity(
        morph=gs.morphs.Mesh(
            file="meshes/sphere.obj",
            scale=0.5,
            pos=(0.0, -3, 0.0),
        ),
        surface=gs.surfaces.Rough(
            diffuse_texture=gs.textures.ColorTexture(
                color=(1.0, 0.5, 0.5),
            ),
        ),
    )
    # user specified color (using color shortcut)
    scene.add_entity(
        morph=gs.morphs.Mesh(
            file="meshes/sphere.obj",
            scale=0.5,
            pos=(0.0, -1.8, 0.0),
        ),
        surface=gs.surfaces.Rough(
            color=(1.0, 1.0, 1.0),
        ),
    )
    # smooth shortcut
    scene.add_entity(
        morph=gs.morphs.Mesh(
            file="meshes/sphere.obj",
            scale=0.5,
            pos=(0.0, -0.6, 0.0),
        ),
        surface=gs.surfaces.Smooth(
            color=(0.6, 0.8, 1.0),
        ),
    )
    # Iron
    scene.add_entity(
        morph=gs.morphs.Mesh(
            file="meshes/sphere.obj",
            scale=0.5,
            pos=(0.0, 0.6, 0.0),
        ),
        surface=gs.surfaces.Iron(
            color=(1.0, 1.0, 1.0),
        ),
    )
    # Gold
    scene.add_entity(
        morph=gs.morphs.Mesh(
            file="meshes/sphere.obj",
            scale=0.5,
            pos=(0.0, 1.8, 0.0),
        ),
        surface=gs.surfaces.Gold(
            color=(1.0, 1.0, 1.0),
        ),
    )
    # Glass
    scene.add_entity(
        morph=gs.morphs.Mesh(
            file="meshes/sphere.obj",
            scale=0.5,
            pos=(0.0, 3.0, 0.0),
        ),
        surface=gs.surfaces.Glass(
            color=(1.0, 1.0, 1.0),
        ),
    )
    # Opacity
    scene.add_entity(
        morph=gs.morphs.Mesh(
            file="meshes/sphere.obj",
            scale=0.5,
            pos=(2.0, -3, 0.0),
        ),
        surface=gs.surfaces.Smooth(color=(1.0, 1.0, 1.0, 0.5)),
    )
    # asset's own attributes
    scene.add_entity(
        morph=gs.morphs.Mesh(
            file="meshes/wooden_sphere_OBJ/wooden_sphere.obj",
            scale=0.15,
            pos=(2.2, -2.3, 0.0),
        ),
    )
    # override asset's attributes
    scene.add_entity(
        morph=gs.morphs.Mesh(
            file="meshes/wooden_sphere_OBJ/wooden_sphere.obj",
            scale=0.15,
            pos=(2.2, -1.0, 0.0),
        ),
        surface=gs.surfaces.Rough(
            diffuse_texture=gs.textures.ImageTexture(
                image_path="textures/checker.png",
            )
        ),
    )
    ########################## cameras ##########################
    cam_0 = scene.add_camera(
        res=(1600, 900),
        pos=(8.5, 0.0, 1.5),
        lookat=(3.0, 0.0, 0.7),
        fov=60,
        GUI=True,
        spp=512,
    )
    scene.build()

    ########################## forward + backward twice ##########################
    scene.reset()
    horizon = 2000

    for i in range(horizon):
        scene.step()
        cam_0.render()


if __name__ == "__main__":
    main()

@Kashu7100
Copy link
Collaborator

Can you try to install nvidia-driver-550 for CUDA12.4?

@coghks625
Copy link

coghks625 commented Dec 30, 2024

When running on NVIDIA driver 550 with CUDA 12.4, all files except the IK tutorial file worked without any issues. I made various attempts to resolve the segmentation fault in the IK tutorial file, and I confirmed that the segmentation fault does not occur in the CUDA 12.1 environment.

@zhangiser
Copy link
Author

zhangiser commented Dec 30, 2024

@Kashu7100 @coghks625
I have tried download NVIDIA driver 550,but only found 552.44 from nvdia offical website History Version.

image

And the error is still there.
nvidia-smi info:

C:\Users\zhangiser>nvidia-smi
Mon Dec 30 20:10:27 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 552.44                 Driver Version: 552.44         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                     TCC/WDDM  | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4080 ...  WDDM  |   00000000:01:00.0 Off |                  N/A |
| N/A   45C    P0             29W /  155W |       0MiB /  12282MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

error info[Segmentation fault (core dumped)]:

(torch) root@zhangiser-pc:/usr/Genesis# /root/miniconda3/envs/torch/bin/python /usr/Genesis/examples/rendering/demo.py
[Genesis] [18:53:33] [INFO] ╭─────────────────────────────────────────────────────────────────────────────────────╮
[Genesis] [18:53:33] [INFO] │┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉ Genesis ┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉│
[Genesis] [18:53:33] [INFO] ╰─────────────────────────────────────────────────────────────────────────────────────╯
[Genesis] [18:53:34] [INFO] Running on [NVIDIA GeForce RTX 4080 Laptop GPU] with backend gs.cuda. Device memory: 11.99 GB.
[Genesis] [18:53:36] [DEBUG] [Taichi] version 1.7.2, llvm 15.0.4, commit 0131dce9, linux, python 3.9.21
[Genesis] [18:53:36] [DEBUG] [Taichi] Starting on arch=cuda
[Genesis] [18:53:36] [INFO] 🚀 Genesis initialized. 🔖 version: 0.2.0, 🌱 seed: 0, 📏 precision: '32', 🐛 debug: False, 🎨 theme: 'dark'.
[Genesis] [18:53:39] [INFO] Scene <579af45> created.
[Genesis] [18:53:39] [INFO] Adding <gs.RigidEntity>. idx: 0, uid: <c233424>, morph: <gs.morphs.Plane>, material: <gs.materials.Rigid>.
[Genesis] [18:53:39] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 0.
[Genesis] [18:53:39] [INFO] Adding <gs.RigidEntity>. idx: 1, uid: <ddf49f8>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [18:53:40] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 1.
[Genesis] [18:53:40] [INFO] Adding <gs.RigidEntity>. idx: 2, uid: <5284270>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [18:53:40] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 2.
[Genesis] [18:53:40] [INFO] Adding <gs.RigidEntity>. idx: 3, uid: <83c3566>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [18:53:40] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 3.
[Genesis] [18:53:40] [INFO] Adding <gs.RigidEntity>. idx: 4, uid: <47933bc>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [18:53:40] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 4.
[Genesis] [18:53:40] [INFO] Adding <gs.RigidEntity>. idx: 5, uid: <849b29b>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [18:53:40] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 5.
[Genesis] [18:53:40] [INFO] Adding <gs.RigidEntity>. idx: 6, uid: <8b3d6fc>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [18:53:40] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 6.
[Genesis] [18:53:40] [INFO] Adding <gs.RigidEntity>. idx: 7, uid: <beb84a4>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [18:53:40] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 7.
[Genesis] [18:53:40] [INFO] Adding <gs.RigidEntity>. idx: 8, uid: <f7ab5cf>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/wooden_sphere_OBJ/wooden_sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [18:53:41] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 8.
[Genesis] [18:53:41] [INFO] Adding <gs.RigidEntity>. idx: 9, uid: <8dde267>, morph: <gs.morphs.Mesh(file='/root/miniconda3/envs/torch/lib/python3.9/site-packages/genesis/assets/meshes/wooden_sphere_OBJ/wooden_sphere.obj')>, material: <gs.materials.Rigid>.
[Genesis] [18:53:42] [DEBUG] Preprocessed `.gsd` file found in cache for geom idx 9.
[Genesis] [18:53:42] [INFO] Building scene <579af45>...
[Genesis] [18:53:45] [INFO] Compiling simulation kernels...
[Genesis] [18:53:48] [INFO] Building visualizer...
Segmentation fault (core dumped)

@coghks625
Copy link

@zhangiser try cuda 12.1

@zhangiser
Copy link
Author

@coghks625

I have tried cuda12.1 but also get Segmentation fault (core dumped)
nvcc info:

(base) root@zhangiser-pc:/usr/wsl# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0

nvidia-smi:

(base) root@zhangiser-pc:/usr/wsl# nvidia-smi
Tue Dec 31 10:50:15 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.76.01              Driver Version: 552.44         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4080 ...    On  |   00000000:01:00.0 Off |                  N/A |
| N/A   48C    P0             26W /  155W |       0MiB /  12282MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

torch info:

(base) root@zhangiser-pc:/usr/wsl# conda activate torch
(torch) root@zhangiser-pc:/usr/wsl# python
Python 3.9.21 | packaged by conda-forge | (main, Dec  5 2024, 13:51:40)
[GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True

Guess maybe other problems.
I have tried nvidia driver 566 522 and cuda 12.4.2 12.4.1 12.1.1 until now。

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

No branches or pull requests

4 participants