No module named 'LuisaRenderPy'
python examples/rendering/demo.py
[Genesis] [23:14:40] [INFO] ╭───────────────────────────────────────────────╮
[Genesis] [23:14:40] [INFO] │┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈ Genesis ┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈┉┈│
[Genesis] [23:14:40] [INFO] ╰───────────────────────────────────────────────╯
[Genesis] [23:14:41] [INFO] Running on [NVIDIA GeForce RTX 4070 Laptop GPU] with backend gs.cuda. Device memory: 7.75 GB.
[Genesis] [23:14:42] [DEBUG] [Taichi] version 1.7.2, llvm 15.0.4, commit 0131dce9, linux, python 3.10.16
[Genesis] [23:14:42] [DEBUG] [Taichi] Starting on arch=cuda
[Genesis] [23:14:42] [INFO] 🚀 Genesis initialized. 🔖 version: 0.2.0, 🌱 seed: 0, 📏 precision: '32', 🐛 debug: False, 🎨 theme: 'dark'.
Traceback (most recent call last):
File "/home/xxh/anaconda3/envs/genesis/lib/python3.10/site-packages/genesis/vis/raytracer.py", line 17, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/xxh/Documents/Genesis-main/examples/rendering/demo.py", line 166, in
[Genesis] [23:14:44] [ERROR] Failed to import LuisaRenderer. ModuleNotFoundError: No module named 'LuisaRenderPy'
How to fix this?Is LuisaRender not installed properly? Has anyone solved this problem?
Luisa raytracing rendering requires building as mentioned here. We will update the installation guide soon. Stay tuned.
I'm having a similar issue here as well. It seems like python bindings are not being generated at all when luisa-render is compiled and built.
I'm having a similar issue here as well. It seems like python bindings are not being generated at all when luisa-render is compiled and built.
Do you fix it?
Luisa raytracing rendering requires building as mentioned here. We will update the installation guide soon. Stay tuned.
I built LuisaRender. But it still does't work
The problem is that the file is generated correctly after build in the folder genesis/Genesis/genesis/ext/LuisaRender/build/bin/LuisaRenderPy.cpython-312-x86_64-linux-gnu.so
However it is not imported correctly in the renderer code. In my system the variable LRP_PATH in file raytracer.py maps to /home/root/src/genesis/lib/python3.12/site-packages/genesis/ which is not where the module is built.
As a temporary fix I have modified the local copy of the file raytracer.py:14 to specify the correct LRP_PATH. Hope this helps.
thanks akash. LuisaRenderPy.cpython-312-x86_64-linux-gnu.so is not generated for me for some reason. I also looks through the luisarender's cmake files, I couldn't find any line that instructs the compiler to generate that file.
What version of luisa are you using and how are you building it?
The problem is that the file is generated correctly after build in the folder
genesis/Genesis/genesis/ext/LuisaRender/build/bin/LuisaRenderPy.cpython-312-x86_64-linux-gnu.soHowever it is not imported correctly in the renderer code. In my system the variable
LRP_PATHin file raytracer.py maps to/home/root/src/genesis/lib/python3.12/site-packages/genesis/which is not where the module is built.As a temporary fix I have modified the local copy of the file
raytracer.py:14to specify the correct LRP_PATH. Hope this helps.
In my system the variable LRP_PATH in file raytracer.py maps to 'ext/LuisaRender/build/bin' which seem right. However, 'LuisaRenderPy.cpython-312-x86_64-linux-gnu.so' isn't exist. I can't find 'LuisaRenderPy.cpython-312-x86_64-linux-gnu.so' in my system. It seem the problem of the LuisaRender building. But it doen't report error when I built LuisaRender.
thanks akash.
LuisaRenderPy.cpython-312-x86_64-linux-gnu.sois not generated for me for some reason. I also looks through the luisarender's cmake files, I couldn't find any line that instructs the compiler to generate that file.What version of luisa are you using and how are you building it?
Same problem!
The problem is that the file is generated correctly after build in the folder
genesis/Genesis/genesis/ext/LuisaRender/build/bin/LuisaRenderPy.cpython-312-x86_64-linux-gnu.soHowever it is not imported correctly in the renderer code. In my system the variable
LRP_PATHin file raytracer.py maps to/home/root/src/genesis/lib/python3.12/site-packages/genesis/which is not where the module is built.As a temporary fix I have modified the local copy of the file
raytracer.py:14to specify the correct LRP_PATH. Hope this helps. thanks akash. Zhang Shaokun replied me that 'Genesis uses a forked version of LuisaRender maintained by their project’s developers.' What version of luisa are you using?
The problem is that the file is generated correctly after build in the folder
genesis/Genesis/genesis/ext/LuisaRender/build/bin/LuisaRenderPy.cpython-312-x86_64-linux-gnu.soHowever it is not imported correctly in the renderer code. In my system the variable
LRP_PATHin file raytracer.py maps to/home/root/src/genesis/lib/python3.12/site-packages/genesis/which is not where the module is built.As a temporary fix I have modified the local copy of the file
raytracer.py:14to specify the correct LRP_PATH. Hope this helps.
Zheng Shaokun replied me that 'Genesis uses a forked version of LuisaRender maintained by their project’s developers. ' What version of luisa are you using?
It's possible to manually link the LuisaRenderPy.cpython-312-x86_64-linux-gnu.so to the conda python enviroment:
SITE_PACKAGES=$(python -c "import site; print(site.getsitepackages()[0])")
ln -s /full/path/to/build/LuisaRenderPy.cpython-312-x86_64-linux-gnu.so "$SITE_PACKAGES/LuisaRenderPy.cpython-312-x86_64-linux-gnu.so"
How do I get LuisaRenderPy? If I compile the code as stated in the installation instructions, it does not compile packages for Python.
How do I get LuisaRenderPy? If I compile the code as stated in the installation instructions, it does not compile packages for Python.
You built the wrong LuisaRender version. The LusiaRender in 'https://github.com/LuisaGroup/LuisaRender.git' can't generate LuisaRenderPy.cpython-312-x86_64-linux-gnu.so.
Alif-01's fork update python interface(https://github.com/Alif-01/LuisaRender.git) . I built it and LuisaRenderPy.cpython-312-x86_64-linux-gnu.so was generated. You need python3.12 to import LuisaRenderPy. (LuisaRenderPy.cpython-312-x86_64-linux-gnu.so should be renamed as LuisaRenderPy.so )
However, I meet the new error. [2024-12-20 12:25:48.553] [console] [warning] Failed to load built-in kernels: the provided PTX was compiled with an unsupported toolchain.. Re-trying with lower compute capability... [/home/xxh/Downloads/LuisaRender/src/compute/src/backends/cuda/cuda_device.cpp:127] [2024-12-20 12:25:48.575] [console] [error] CUDA_ERROR_UNSUPPORTED_PTX_VERSION: the provided PTX was compiled with an unsupported toolchain. [/home/xxh/Downloads/LuisaRender/src/compute/src/backends/cuda/cuda_device.cpp:136]
It seems that I have to reinstall lower version CUDA. ACMLCZH also updated python interface. I am trying to build his fork.
How do I get LuisaRenderPy? If I compile the code as stated in the installation instructions, it does not compile packages for Python. I have install the LuisaRender Ubuntu 22.04 Nvidia driver 535.183.01,cuda 12.2! I update the cuda! python 3.10 git clone https://github.com/Genesis-Embodied-AI/Genesis.git cd Genesis git submodule update --init --recursive
You should follow the user guider to install the Dependencies.
cd genesis/ext/LuisaRender cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D PYTHON_VERSIONS=3.10 -D LUISA_COMPUTE_DOWNLOAD_NVCOMP=ON -D LUISA_COMPUTE_ENABLE_GUI=OFF cmake --build build -j $(nproc)
Finall I copy the etx folder to my conda envs. It works!
Perfect! thanks @Xu-Xuanhui
In my case need some extra tweaks))
1. Install Required Dependencies
Install GCC and G++ for Linux
Ensure you have the necessary compilers installed in your environment. Use conda to install them:
conda install -c conda-forge gcc_linux-64 gxx_linux-64
Install NVIDIA CUDA Toolkit
Install the CUDA toolkit on your system using your package manager. For example, on Ubuntu:
sudo apt install nvidia-cuda-toolkit
2. Recompile LuisaRenderer with CUDA Support
If the LuisaRenderer library was not compiled with CUDA support, you need to recompile it.
Steps to Recompile
-
Navigate to the
LuisaRenderersource directory:cd /path/to/LuisaRenderer -
Clean the previous build (if any):
rm -rf build -
Configure the build with CUDA support (LUISA_COMPUTE_ENABLE_CUDA=ON):
cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D PYTHON_VERSIONS=3.9 -D LUISA_COMPUTE_DOWNLOAD_NVCOMP=ON -D LUISA_COMPUTE_ENABLE_GUI=OFF -D LUISA_COMPUTE_ENABLE_CUDA=ON -
Build the project:
cmake --build build -j $(nproc)
Check CUDA Version
Run the following command to check the installed CUDA version:
nvcc --version
Verify CUDA Libraries
Check if the CUDA libraries are available:
find /usr -name "libcudart.so" 2>/dev/null
If the output shows the path to libcudart.so, CUDA is installed correctly.
After troubleshooting, I found the root cause of the issue I encountered:
- First, I installed the official release package using the command pip install genesis-world.
- Then, I downloaded the Genesis code via git clone to a local directory and used cmake to compile the related files for LuisaRenderPy.
- When attempting to run demo.py, the genesis code being imported was located in the library path of the pip-installed environment (e.g., /home/user/venv/torch/lib/python3.10/site-packages/genesis/), which is not in the same directory as the parent directory where LuisaRenderPy is located.
- When genesis called the code in raytracer.py (specifically, miscu.get_src_dir), it naturally referred to the pip-installed library path, and therefore, it couldn't find the locally compiled LuisaRenderPy files in the other directory.
There are two potential solutions:
- Copy the related files to pip-installed library path
- Instead of installing the official release package, download the code manually, compile the LuisaRenderPy files, repackage it (ensuring the compiled LuisaRenderPy files are included), and then install the newly packaged version.
Here’s a concise solution:
Problem:
The command cmake --build build -j $(nproc) installs the LuisaRenderPy dynamic libraries (e.g., LuisaRenderPy.cpython-39-x86_64-linux-gnu.so) by default to the genesis/ext/LuisaRender/build/bin directory, rather than to the Python environment.
Solution:
To resolve this, create a symbolic link to the LuisaRender folder in your Python environment:
# inside Genesis/
SITE_PACKAGES=$(python -c "import site; print(site.getsitepackages()[0])")
ln -s genesis/ext/LuisaRender "$SITE_PACKAGES/genesis/ext/LuisaRender"
How do I get LuisaRenderPy? If I compile the code as stated in the installation instructions, it does not compile packages for Python. I have install the LuisaRender Ubuntu 22.04 Nvidia driver 535.183.01,cuda 12.2! I update the cuda! python 3.10 git clone https://github.com/Genesis-Embodied-AI/Genesis.git cd Genesis git submodule update --init --recursive
You should follow the user guider to install the Dependencies.
cd genesis/ext/LuisaRender cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D PYTHON_VERSIONS=3.10 -D LUISA_COMPUTE_DOWNLOAD_NVCOMP=ON -D LUISA_COMPUTE_ENABLE_GUI=OFF cmake --build build -j $(nproc)
Finall I copy the etx folder to my conda envs. It works!
I copied genesis/ext/LuisaRender/build/bin/* to root\miniconda3\envs\torch\lib\python3.9\site-packages\genesis\ext\LuisaRender,But also get error No module named 'LuisaRenderPy',Why?