Hi all,
I am currently trying to compile tinycudann in conda and having some trouble with compilation. The error I am getting is
/home/uname/miniconda3/envs/nerfstudio/bin/x86_64-conda-linux-gnu-c++ -shared -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-rpath,/home/uname/miniconda3/envs/nerfstudio/lib -L/home/uname/miniconda3/envs/nerfstudio/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-rpath,/home/uname/miniconda3/envs/nerfstudio/lib -L/home/uname/miniconda3/envs/nerfstudio/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/home/uname/miniconda3/envs/nerfstudio/lib -Wl,-rpath-link,/home/uname/miniconda3/envs/nerfstudio/lib -L/home/uname/miniconda3/envs/nerfstudio/lib -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/uname/miniconda3/envs/nerfstudio/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/uname/miniconda3/envs/nerfstudio/include build/temp.linux-x86_64-cpython-38/../../dependencies/fmt/src/format.o build/temp.linux-x86_64-cpython-38/../../dependencies/fmt/src/os.o build/temp.linux-x86_64-cpython-38/../../src/common_host.o build/temp.linux-x86_64-cpython-38/../../src/cpp_api.o build/temp.linux-x86_64-cpython-38/../../src/cutlass_mlp.o build/temp.linux-x86_64-cpython-38/../../src/encoding.o build/temp.linux-x86_64-cpython-38/../../src/fully_fused_mlp.o build/temp.linux-x86_64-cpython-38/../../src/network.o build/temp.linux-x86_64-cpython-38/../../src/object.o build/temp.linux-x86_64-cpython-38/tinycudann/bindings.o -L/home/uname/miniconda3/envs/nerfstudio/lib/python3.8/site-packages/torch/lib -L/home/uname/miniconda3/envs/nerfstudio/lib -lcuda -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-cpython-38/tinycudann_bindings/_89_C.cpython-38-x86_64-linux-gnu.so
/home/uname/miniconda3/envs/nerfstudio/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lcuda
I think the problem is about the search path. However, I checked my environment variables
(nerfstudio) uname@airbus-a380:~/nerfstudio$ echo $LD_LIBRARY_PATH
/home/uname/miniconda3/envs/nerfstudio/lib/stubs/:/home/uname/miniconda3/pkgs/cuda-driver-dev-11.8.89-0/lib/stubs/:/home/uname/miniconda3/envs/nerfstudio/lib:
(nerfstudio) uname@airbus-a380:~/nerfstudio$ echo $LIBRARY_PATH
/home/uname/miniconda3/envs/nerfstudio/lib/stubs/:/home/uname/miniconda3/pkgs/cuda-driver-dev-11.8.89-0/lib/stubs/:/home/uname/miniconda3/envs/nerfstudio/lib:
includes directory that contain libcuda.so
.
In addition, I notice that when using system g++, I am able to find libcuda.so
and print-search-dirs returns
(nerfstudio) uname@airbus-a380:~/nerfstudio$ g++ --print-search-dirs
install: /usr/lib/gcc/x86_64-linux-gnu/13/
programs: =/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/bin/
libraries: =/home/uname/miniconda3/envs/nerfstudio/lib/stubs/x86_64-linux-gnu/13/:/home/uname/miniconda3/envs/nerfstudio/lib/stubs/x86_64-linux-gnu/:/home/uname/miniconda3/envs/nerfstudio/lib/stubs/../lib/:/home/uname/miniconda3/pkgs/cuda-driver-dev-11.8.89-0/lib/stubs/x86_64-linux-gnu/13/:/home/uname/miniconda3/pkgs/cuda-driver-dev-11.8.89-0/lib/stubs/x86_64-linux-gnu/:/home/uname/miniconda3/pkgs/cuda-driver-dev-11.8.89-0/lib/stubs/../lib/:/home/uname/miniconda3/envs/nerfstudio/lib/x86_64-linux-gnu/13/:/home/uname/miniconda3/envs/nerfstudio/lib/x86_64-linux-gnu/:/home/uname/miniconda3/envs/nerfstudio/lib/../lib/:./x86_64-linux-gnu/13/:./x86_64-linux-gnu/:./../lib/:/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/:/lib/x86_64-linux-gnu/13/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/13/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/home/uname/miniconda3/envs/nerfstudio/lib/stubs/:/home/uname/miniconda3/pkgs/cuda-driver-dev-11.8.89-0/lib/stubs/:/home/uname/miniconda3/envs/nerfstudio/lib/:./:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/lib/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../:/lib/:/usr/lib/
which includes the proper directories but for the compilers used by conda as shown in the above error message, I am getting
(nerfstudio) uname@airbus-a380:~/nerfstudio$ /home/uname/miniconda3/envs/nerfstudio/bin/x86_64-conda-linux-gnu-c++ -print-search-dirs
install: /home/uname/miniconda3/envs/nerfstudio/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/
programs: =/home/uname/miniconda3/envs/nerfstudio/bin/../libexec/gcc/x86_64-conda-linux-gnu/9.3.0/:/home/uname/miniconda3/envs/nerfstudio/bin/../libexec/gcc/:/home/uname/miniconda3/envs/nerfstudio/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/x86_64-conda-linux-gnu/9.3.0/:/home/uname/miniconda3/envs/nerfstudio/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/
libraries: =/home/uname/miniconda3/envs/nerfstudio/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/:/home/uname/miniconda3/envs/nerfstudio/bin/../lib/gcc/:/home/uname/miniconda3/envs/nerfstudio/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/lib/x86_64-conda-linux-gnu/9.3.0/:/home/uname/miniconda3/envs/nerfstudio/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/lib/../lib/:/home/uname/miniconda3/envs/nerfstudio/bin/../x86_64-conda-linux-gnu/sysroot/lib/x86_64-conda-linux-gnu/9.3.0/:/home/uname/miniconda3/envs/nerfstudio/bin/../x86_64-conda-linux-gnu/sysroot/lib/../lib/:/home/uname/miniconda3/envs/nerfstudio/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/x86_64-conda-linux-gnu/9.3.0/:/home/uname/miniconda3/envs/nerfstudio/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/../lib/:/home/uname/miniconda3/envs/nerfstudio/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/lib/:/home/uname/miniconda3/envs/nerfstudio/bin/../x86_64-conda-linux-gnu/sysroot/lib/:/home/uname/miniconda3/envs/nerfstudio/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/
which is different from those of system g++ and doesn’t include the directory containing the library.
I am running conda 24.7.1 on Ubuntu 24.04. Any clue about how I can fix the search path for conda g++? Thanks in advance.