Skip to content

[Bug]: Importing Genesis in Docker Results in libGLU.so.1 Error #1895

@schlagercollin

Description

@schlagercollin

Bug Description

It looks like importing genesis requires libGLU.so.1 which isn't available in the docker environment described in the README.

As a result, running the examples within the Docker container results in a shared library error.

root@ee0831268b8b:/workspace# python -c "import genesis"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/workspace/genesis/__init__.py", line 381, in <module>
    from pygel3d import graph, hmesh
  File "/opt/conda/lib/python3.11/site-packages/pygel3d/__init__.py", line 50, in <module>
    lib_py_gel = ct.cdll.LoadLibrary(_get_script_path() + "/" + _get_lib_name())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/ctypes/__init__.py", line 454, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libGLU.so.1: cannot open shared object file: No such file or directory

Alternatively,

root@ee0831268b8b:/workspace# python examples/smoke.py  
[GsTaichi] version 3.0.0, llvm 15.0.7, commit 7fb4ee55, linux, python 3.11.10
Traceback (most recent call last):
  File "/workspace/examples/smoke.py", line 10, in <module>
    import genesis as gs
  File "/opt/conda/lib/python3.11/site-packages/genesis/__init__.py", line 381, in <module>
    from pygel3d import graph, hmesh
  File "/opt/conda/lib/python3.11/site-packages/pygel3d/__init__.py", line 50, in <module>
    lib_py_gel = ct.cdll.LoadLibrary(_get_script_path() + "/" + _get_lib_name())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/ctypes/__init__.py", line 454, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libGLU.so.1: cannot open shared object file: No such file or directory

Steps to Reproduce

# build / run docker as described in README
docker build -t genesis -f docker/Dockerfile docker

xhost +local:root

docker run --gpus all --rm -it \
-e DISPLAY=$DISPLAY \
-e LOCAL_USER_ID="$(id -u)" \
-v /dev/dri:/dev/dri \
-v /tmp/.X11-unix/:/tmp/.X11-unix \
-v $(pwd):/workspace \
--name genesis genesis:latest

# import genesis and/or run an example
python -c "import genesis"
python examples/smoke.py

Expected Behavior

Import and example(s) should run similar to non-Docker environment

Screenshots/Videos

No response

Relevant log output

Environment

OS: Ubuntu 24.04 (Host); Ubuntu 22.04.3 (Docker)
GPU/CPU: NVIDIA GeForce RTX 4070 Ti SUPER / AMD Ryzen 7 7800X3D 8-Core
GPU-driver version 575.57.08
CUDA / CUDA-toolkit version 12.9

Release version or Commit ID

8528dac

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Mid priority issuebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions