解决办法
conda install tree
解决办法
fuser -v /dev/nvidia*
或者有管理员权限的时候
sudo fuser -v /dev/nvidia*
sudo kill -9 进程号
在MobaXterm上
(base) xxx@xxx:~$ env | grep DISPLAY
DISPLAY=localhost:10.0
在VScode的终端上:
export DISPLAY=localhost:10.0
通俗易懂的好文章
关闭vscode
ctrl+R 输入 cmd ,输入以下命令;
code --no-sandbox
重启电脑
问题解决
nvcc和nvidia-smi显示的版本不一致?
在vscode中打开.bashrc
,在最后添加CUDA版本路径:
# CUDA Soft Link
export PATH="/usr/local/cuda-10.1/bin:$PATH"
export LD_LIBRARY_PATH="/usr/lcoal/cuda-10.1/lib64:$LD_LIBRARY_PATH"
根据/usr/local/
中有的CUDA版本,就可以切换当前使用的CUDA版本
NVIDIA官方算力表
nvidia显卡和CUDA版本关系
修改nvvm.py:打开/anaconda3/envs/your_env/lib/python3.7/site-packages/numba/cuda/cudadrv/nvvm.py
,
# 加上1080 Ti的适配算力
def get_supported_ccs():
global _supported_cc
if _supported_cc:
return _supported_cc
try:
from numba.cuda.cudadrv.runtime import runtime
cudart_version = runtime.get_version()
except: # noqa: E722
# The CUDA Runtime may not be present
cudart_version = (0, 0)
print('cudart_version: ', cudart_version)
# cudart_version: (10, 1)
ctk_ver = f"{cudart_version[0]}.{cudart_version[1]}"
unsupported_ver = f"CUDA Toolkit {ctk_ver} is unsupported by Numba - " \
+ "10.2 is the minimum required version."
print('ctk_ver: ', ctk_ver)
# ctk_ver: 10.1
# List of supported compute capability in sorted order
if cudart_version == (0, 0):
_supported_cc = ()
# GTX 1080 Ti
elif cudart_version == (10, 1):
_supported_cc = ((3, 5), (3, 7),
(5, 0), (5, 2), (5, 3),
(6, 0), (6, 1), (6, 2),
(7, 0), (7, 2), (7, 5))
elif cudart_version == (10, 2):
_supported_cc = ((3, 5), (3, 7),
(5, 0), (5, 2), (5, 3),
(6, 0), (6, 1), (6, 2),
(7, 0), (7, 2), (7, 5))
elif cudart_version == (11, 0):
_supported_cc = ((3, 5), (3, 7),
(5, 0), (5, 2), (5, 3),
(6, 0), (6, 1), (6, 2),
(7, 0), (7, 2), (7, 5),
(8, 0))
elif cudart_version > (11, 0):
_supported_cc = ((3, 5), (3, 7),
(5, 0), (5, 2), (5, 3),
(6, 0), (6, 1), (6, 2),
(7, 0), (7, 2), (7, 5),
(8, 0), (8, 6))
elif cudart_version > (11, 4):
_supported_cc = ((3, 5), (3, 7),
(5, 0), (5, 2), (5, 3),
(6, 0), (6, 1), (6, 2),
(7, 0), (7, 2), (7, 5),
(8, 0), (8, 6), (8, 7))
else:
_supported_cc = ()
warnings.warn(unsupported_ver)
return _supported_cc
参考博客
参考博客
降低pip版本:
python -m pip install pip==20.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
报错如下:
ImportError: libcudart.so.9.1: cannot open shared object file: No such file or directory
解决办法:
删除pip的缓存rm -r ~/.cache/pip
然后重装anaconda环境(重开)