mesh renderer failed
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13.7k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Hi, wonderful work and thank you for your share.
But I met a problem I've never seen before today. My running environment: Ubuntu 20.04, cuda - 11.8, torch - 2.4.0.
Strangely, the gaussian and radiance field outputs are generated successfully except when generating the mesh.
Here's the fault message:
Error building extension 'nvdiffrast_plugin': [1/16] :/usr/local/cuda:/usr/local/cuda/bin/nvcc --generate-dependencies-with-compile --dependency-output RasterImpl.cuda.o.d -DTORCH_EXTENSION_NAME=nvdiffrast_plugin -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/TH -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/THC -isystem :/usr/local/cuda:/usr/local/cuda/include -isystem /home/jane/anaconda3/envs/trellis/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 --compiler-options '-fPIC' -DNVDR_TORCH -lineinfo -std=c++17 -c /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/nvdiffrast/common/cudaraster/impl/RasterImpl.cu -o RasterImpl.cuda.o
FAILED: RasterImpl.cuda.o
...
[15/16] c++ -MMD -MF RasterImpl.o.d -DTORCH_EXTENSION_NAME=nvdiffrast_plugin -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/TH -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/THC -isystem :/usr/local/cuda:/usr/local/cuda/include -isystem /home/jane/anaconda3/envs/trellis/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++17 -DNVDR_TORCH -c /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/nvdiffrast/common/cudaraster/impl/RasterImpl.cpp -o RasterImpl.o
FAILED: RasterImpl.o
c++ -MMD -MF RasterImpl.o.d -DTORCH_EXTENSION_NAME=nvdiffrast_plugin -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/TH -isystem /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/THC -isystem :/usr/local/cuda:/usr/local/cuda/include -isystem /home/jane/anaconda3/envs/trellis/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++17 -DNVDR_TORCH -c /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/nvdiffrast/common/cudaraster/impl/RasterImpl.cpp -o RasterImpl.o
In file included from /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAContext.h:3,
from /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/nvdiffrast/common/cudaraster/impl/../../framework.h:37,
from /home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/nvdiffrast/common/cudaraster/impl/RasterImpl.cpp:9:
/home/jane/anaconda3/envs/trellis/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAContextLight.h:6:10: fatal error: cuda_runtime_api.h: No such file or directory
6 | #include <cuda_runtime_api.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
The above exception was the direct cause of the following exception:
File "/home/jane/Desktop/TRELLIS/trellis/renderers/mesh_renderer.py", line 52, in __init__
self.glctx = dr.RasterizeCudaContext(device=device)
File "/home/jane/Desktop/TRELLIS/trellis/utils/render_utils.py", line 62, in render_frames
renderer = MeshRenderer()
File "/home/jane/Desktop/TRELLIS/trellis/utils/render_utils.py", line 96, in render_video
return render_frames(sample, extrinsics, intrinsics, {'resolution': resolution, 'bg_color': bg_color}, **kwargs)
File "/home/jane/Desktop/TRELLIS/example.py", line 45, in <module>
video = render_utils.render_video(outputs['mesh'][0])['normal']
Then I tried again, and it occurred the same way.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at trellis/renderers/mesh_renderer.py:52 and follow the call path through trellis/utils/render_utils.py and example.py:45. Reproduce the mesh-rendering command and inspect the nvdiffrast extension build output, especially the missing cuda_runtime_api.h include. Done means the mesh-rendering path completes successfully in the reported environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, python
- Domain
- build-system, computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100