lfranke / TRIPS

https://lfranke.github.io/trips/
MIT License
495 stars 28 forks source link

make -j10 error #14

Closed hadillivvy closed 4 months ago

hadillivvy commented 4 months ago

Hello,

I tried to install your library on my Ubuntu 22.04 machine with CUDA 11.8. I reached all the way to command make -j10 however, I got the following error and I'm not sure how to resolve it since I didn't find any solutions online:

[ 98%] Linking CXX executable ../../bin/viewer
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaGraphDebugDotPrint@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaGraphRetainUserObject@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaUserObjectCreate@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaStreamUpdateCaptureDependencies@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaFreeAsync@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaStreamGetCaptureInfo_v2@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaLaunchKernelExC@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaGraphInstantiateWithFlags@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaMallocAsync@libcudart.so.11.0'
collect2: error: ld returned 1 exit status
make[2]: *** [src/apps/CMakeFiles/viewer.dir/build.make:141: bin/viewer] Error 1
make[1]: *** [CMakeFiles/Makefile2:2898: src/apps/CMakeFiles/viewer.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Linking CXX executable ../../bin/train
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaGraphDebugDotPrint@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaStreamUpdateCaptureDependencies@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaStreamGetCaptureInfo_v2@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaFreeAsync@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaLaunchKernelExC@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaGraphInstantiateWithFlags@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaMallocAsync@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaGraphRetainUserObject@libcudart.so.11.0'
/usr/bin/ld: /home/hadil/Work/TRIPS/External/libtorch/lib/libtorch_cuda.so: undefined reference to `cudaUserObjectCreate@libcudart.so.11.0'
collect2: error: ld returned 1 exit status
make[2]: *** [src/apps/CMakeFiles/train.dir/build.make:141: bin/train] Error 1
make[1]: *** [CMakeFiles/Makefile2:2861: src/apps/CMakeFiles/train.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Can you please advise? I'd be happy to share any additional information you may need.

lfranke commented 4 months ago

Hi,

looks like some cuda methods are not linked correctly. Can you retry the build with this block here:

conda activate trips

export CONDA=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
export CC=gcc-9
export CXX=g++-9
export CUDAHOSTCXX=g++-9

unset CUDA_HOME

mkdir build
cd build

cmake -DCMAKE_PREFIX_PATH="./External/libtorch/;${CONDA}" ..

make -j10

and if that doesn't work, can you post the output of the cmake -DCMAKE_PREFIX_PATH="./External/libtorch/;${CONDA}" .. call?

hadillivvy commented 4 months ago

Hi @lfranke thank you for getting back to me! I'm not sure what the issue was for me but I tried the installation from scratch and did the following changes:

After making the above changes, I got make -j10 to just produce the error that you mentioned in your repo about @GLIBCXX_3.4.30. Did the fix that you suggested and everything worked perfectly.

I was able to run the viewer to see the train scene!