-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
LuisaRenderPy CUDA backend won't install #275
Comments
Try coda 12.1 instead of 10.1 perhaps? |
I also have Ubuntu 20.04 and I got LuisaRenderPy to acknowledge my installation of CUDA, so I thought I share at least that part: I followed steps described in https://genesis-world.readthedocs.io/en/latest/user_guide/getting_started/visualization.html#photo-realistic-ray-tracing-rendering up until:
meaning, do NOT try: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D PYTHON_VERSIONS=3.9 -D LUISA_COMPUTE_DOWNLOAD_NVCOMP=ON # remember to check python version because you want to carefully configure CUDA first. If you do, the following warnings appear: LuisaRenderPy cmake CUDA warningsDuring cmake configuration of LuisaRenderPy the following warning appeared:
However LuisaRenderPy compiles despite the warnings above, at this stage if you try the rendering demo.py you get a Runtime error and the program crashes:
So LuisaRenderPy really needs a clean, solid CUDA setup to work. Based on @wangyian-me's comment, I gave CUDA 12.1 a try. However, from #207, I see that people are trying CUDA 12.2 with success (for Ubuntu 22.04). Check the maximum CUDA version supported by the installed NVIDIA driverOne thing one needs to be careful about is that when doing foo@bar $ nvidia-smi
Tue Dec 24 00:05:39 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.183.01 Driver Version: 535.183.01 CUDA Version: 12.2(A) |
|-----------------------------------------+----------------------+----------------------+
| 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 Quadro RTX 4000 with Max... Off | 00000000:01:00.0 On | N/A |
| N/A 48C P8 8W / 30W | 853MiB / 8192MiB | 3% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 3738 G /usr/lib/xorg/Xorg 132MiB |
| 0 N/A N/A 5276 G /usr/lib/xorg/Xorg 346MiB |
| 0 N/A N/A 5408 G /usr/bin/gnome-shell 129MiB |
| 0 N/A N/A 9525 G /usr/lib/firefox/firefox 167MiB |
| 0 N/A N/A 628369 G ...erProcess --variations-seed-version 68MiB |
+---------------------------------------------------------------------------------------+
(A) : the maximum CUDA version supported by the installed NVIDIA driver, i.e.:
Driver Version 535.183.01 corresponds to a driver that supports up to CUDA 12.2 How to check your "active" cuda version?do foo@bar $ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243 Answer: How to install CUDA 12.1 (for Ubuntu 20.04)?wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda-repo-ubuntu2004-12-1-local_12.1.0-530.30.02-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-12-1-local_12.1.0-530.30.02-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2004-12-1-local/cuda-D8BCD751-keyring.gpg /usr/share/keyrings/ # this was suggested by previous step
sudo cp /var/cuda-repo-ubuntu2004-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings # this was in the CUDA wiki
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-1 # NOTE (A)
rm cuda-repo-ubuntu2004-12-1-local_12.1.0-530.30.02-1_amd64.deb # optional cleanup NOTE (A): official instructions say:
and this is why one has to do Check which cuda toolkits are installed in your systemfoo@bar $ ls /usr/local | grep cuda
cuda
cuda-12
cuda-12.1
cuda-12.3 For this example, cuda 12, 12.1 and 12.3 are installed on the system, note that cuda folder is a softlink that points to the globally active installed CUDA. In other words to set a default CUDA version on your system do: sudo ln -s /usr/local/cuda-12.1 /usr/local/cuda Which will create a softlink Warning: if for some reason you ran To override, you can either remove nvidia-cuda-toolkit, (be careful and make sure other software installed on your system is not using it), or you can set your environment to set a preference of export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH NOTE: the order of paths within Make sure nvcc points to CUDA 12.1After you configured correctly CUDA/env (using the commands described earlier), make sure that nvcc points to CUDA 12.1: foo@bar $ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Feb__7_19:32:13_PST_2023
Cuda compilation tools, release 12.1, V12.1.66
Build cuda_12.1.r12.1/compiler.32415258_0 As you can see, CUDA 12.1 is now "active". Configure and build LuisaRenderPyThis is were you want to try the rest of the steps described in https://genesis-world.readthedocs.io/en/latest/user_guide/getting_started/visualization.html#photo-realistic-ray-tracing-rendering Starting from:
Meaning, do try: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D PYTHON_VERSIONS=3.9 -D LUISA_COMPUTE_DOWNLOAD_NVCOMP=ON # remember to check python version
cmake --build build -j $(nproc) but added Since I used pyenv, I used slighlty different commands: cd Genesis/genesis/ext/LuisaRender
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=/home/oscar/.pyenv/versions/genesis-sim/lib/python3.10/site-packages -D CMAKE_BUILD_TYPE=Release -D LUISA_COMPUTE_ENABLE_CUDA=ON -D PYTHON_VERSIONS=3.10 -D Python_EXECUTABLE=/home/oscar/.pyenv/versions/genesis-sim/bin/python -D LUISA_COMPUTE_DOWNLOAD_NVCOMP=ON -D CMAKE_CUDA_COMPILER=/usr/local/cuda-12.1/bin/nvcc .. # configure
cmake --build . -j$(nproc) # build Finally CUDA was found!
Now, to be honest... I still have vulkan and other issues (see F), however since this issue is concerned with "LuisaRenderPy CUDA backend won't install" (for ubuntu 20.04), I think I covered at least that part... F:
Update: I resolved some warnings:
|
Cool, thanks @oscar-lima @wangyian-me . I installed CUDA toolkit 12.6 and CUDA drivers 565.57.01, and re-built LuisaRenderPy. Now I am encountering the error Is that directly related, or should I open a new issue? |
@oscar-lima Does the actual compilation of LuisaRender work now with NVTT enabled, or just its build configuration? I'm asking because my configuration also seems find, with NVTT being found, but the compilation errors out: #465 |
I followed the instructions
I have an Ubuntu20.04.
NVIDIA-SMI 535.183.01 Driver Version: 535.183.01 CUDA Version: 12.2
NVIDIA GeForce GTX 1080 Ti
The text was updated successfully, but these errors were encountered: