nerfstudio-project / nerfacc

A General NeRF Acceleration Toolbox in PyTorch.
https://www.nerfacc.com/
Other
1.38k stars 112 forks source link

With nerfstudio, cannot find -lcudart error. #145

Closed KamiCalcium closed 1 year ago

KamiCalcium commented 1 year ago

Env

WSL2 + CUDA11.7 nerfacc is 0.3.2

Can build tiny-cuda-dnn from the source code, also did

pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

Try to run instant-NGP from nerfstudio.

Error message:

FAILED: nerfacc_cuda.so 
c++ pybind.cuda.o render_weight.cuda.o pack.cuda.o cdf.cuda.o render_transmittance.cuda.o intersection.cuda.o render_transmittance_cub.cuda.o contraction.cuda.o ray_marching.cuda.o -shared -L/home/user/anaconda3/envs/nerfstudio/lib/python3.8/site-packages/torch/lib -lc10 -lc10_cuda -ltorch_cpu -ltorch_cuda_cu -ltorch_cuda_cpp -ltorch -ltorch_python -L/home/user/anaconda3/envs/nerfstudio/lib64 -lcudart -o nerfacc_cuda.so
/usr/bin/ld: cannot find -lcudart: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Tried

export LIBRARY_PATH="/usr/local/cuda/lib64:$LIBRARY_PATH"

and

export LIBRARY_PATH="/usr/local/cuda/lib64/stubs:$LIBRARY_PATH"

Does not work. Using ls I do found the libcudart.so is under /usr/local/cuda/lib64.

Any suggestions? Thanks a lot.

KamiCalcium commented 1 year ago

solved with nerfstudio 0.1.15 + nerfacc 0.3.3

ou524u commented 11 months ago

hello, I encountered the same problem with nerfacc 0.5.2 nerfstudio 0.3.4 torch 2.0.1+cu118 torchvision 0.15.2+cu118 the reason for /usr/bin/ld: cannot find -lcudart in my case is that ninja is looking for cudart.o in /home/user/anaconda3/envs/nerfstudio/lib64, but I only have folder lib in that directory not lib64. so in build.ninja I changed that directory to /home/user/anaconda3/envs/nerfstudio/lib, and build successed. hope that may help anyone else.

AIBluefisher commented 10 months ago

I met the same problem. The build.ninja will be overwritten after building. We can simply create a directory /home/user/anaconda3/envs/nerfstudio/lib, and copy libcudart.so into that directory.

Li7068 commented 9 months ago

hello, I encountered the same problem with nerfacc 0.5.2 nerfstudio 0.3.4 torch 2.0.1+cu118 torchvision 0.15.2+cu118 the reason for /usr/bin/ld: cannot find -lcudart in my case is that ninja is looking for cudart.o in /home/user/anaconda3/envs/nerfstudio/lib64, but I only have folder lib in that directory not lib64. so in build.ninja I changed that directory to /home/user/anaconda3/envs/nerfstudio/lib, and build successed. hope that may help anyone else.

hello,can introduce your steps about how to change directory in build.ninja?i even cant find the setting file. TAT