安这个的环境费我好多时间,防止忘记记下来。
1、无权限删除文件
安装cudatoolkit的时候报错:
RuntimeError: Failed to remove /tmp/cuda-installer.log
这个报错直接用下面这个看这个文件是谁的然后让ta删了……真是非常朴实无华的解决办法……
cd /tmp ll
2、安装tiny-cuda-nn
作者给的环境文件让运行:
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
但我之前安装过tiny-cuda-nn,所以进入 ‘/tiny-cuda-nn/bindings/torch/’ 之后直接运行:
python setup.py install
但它报错说 ‘filesystem: No such file or directory’ ,这个大概率是因为gcc版本不够高,运行 ‘gcc --version’ 查看版本,我的版本是7.5.0,于是在conda中升级版本:
conda install openblas-devel -c anaconda -y
conda install -c conda-forge gxx=8 -y
升级版本后再运行setup,报错:
cannot find -lcuda: No such file or directory
这个问题的解决可参考:
https://github.com/NVlabs/tiny-cuda-nn/issues/337
https://github.com/NVlabs/tiny-cuda-nn/issues/183
我寻找到libcuda.so的路径,然后将它添加至环境变量,然后就可以顺利安装了。
find <你认为可能的路径,比如/usr/bin> -name libcuda.so 2>/dev/null
export LD_LIBRARY_PATH=<上一行输出的路径>:$LD_LIBRARY_PATH
export LIBRARY_PATH=<上一行输出的路径>:$LIBRARY_PATH