tiny-cuda-nn踩坑记录
这个b库三番五次折磨我,上次欺负我是因为我还不懂啥是环境变量。
执行pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
报错如下:
/home/ubuntu/miniconda3/envs/mirres/compiler_compat/ld: cannot find -lcuda: 没有那个文件或目录
collect2: error: ld returned 1 exit status
error: command '/usr/bin/g++' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for tinycudann
Running setup.py clean for tinycudann
Failed to build tinycudann
ERROR: Could not build wheels for tinycudann, which is required to install pyproject.toml-based projects
这里显示cannot find -lcuda
有哥们儿有类似的问题给出解决方案:
https://blog.csdn.net/a1040193597/article/details/104414730
错误cannot find -lcuda
意思是编译时未找到libcuda
库。
ls /usr/local/cuda-11.8/lib64/
查看自己cuda对应路径下是否有libcuda.so这个库。
没有的话就用命令
locate libcuda
找到对应的libcuda.so.1文件,在我这里是/usr/lib/x86_64-linux-gnu/libcuda.so.1
然后软链接:
sudo ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.1 /usr/local/cuda-11.8/lib64/libcuda.so
随后即可成功安装tiny-cuda-nn。