【解决问题】记录一些烦人的问题及解决方式(持续更新 | 自用)

1、GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.

解决办法

2、安装tree

conda install tree

3、查询GPU时无进程运行,但是显存却被占用了

解决办法

fuser -v /dev/nvidia*
或者有管理员权限的时候
sudo fuser -v /dev/nvidia*
sudo kill -9 进程号

4、VScode无法显示GUI图像

在MobaXterm上

(base) xxx@xxx:~$ env | grep DISPLAY
DISPLAY=localhost:10.0

在VScode的终端上:

export DISPLAY=localhost:10.0

5、Linux中的软硬连接

通俗易懂的好文章

6、VSCODE无法打开web视图,“Webview Service Worker Error in registration due to invalid document state”

关闭vscode
ctrl+R 输入 cmd ,输入以下命令;
code --no-sandbox
重启电脑
问题解决

7、切换CUDA版本

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版本

8、GPU对应算力

NVIDIA官方算力表

nvidia显卡和CUDA版本关系

9、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

10、pip Failed to establish a new connection: [Errno 101] 网络不可达

参考博客

11、pip安装库报错:WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))

参考博客

降低pip版本:

python -m pip install pip==20.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

12、NVIDIA驱动重装导致cuda版本不匹配

报错如下:

ImportError: libcudart.so.9.1: cannot open shared object file: No such file or directory

解决办法:
删除pip的缓存rm -r ~/.cache/pip
然后重装anaconda环境(重开)

13、ModuleNotFoundError: No module named ‘pip’

python -m ensurepip
python -m pip install --upgrade pip

14、conda报错"requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://mirrors.bfsu.edu.cn/anaconda/cloud/menpo/noarch/current_repodata.json"

在这里插入图片描述
解决办法:恢复默认源

conda config --remove-key channels

15、vscode找不到python解释器

原因:环境中的python插件无法使用
解决办法:删掉重新安装

16、conda create 环境报错

报错时的镜像为:

default_channels:
 - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
 - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
show_channel_urls yes

执行conda create -n paddle python=3.8出现如下报错:

>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
  File "/home/rrl/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 531, in fetch_repodata_remote_request
    resp.raise_for_status()
  File "/home/rrl/anaconda3/lib/python3.8/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://mirrors.bfsu.edu.cn/anaconda/pkgs/free/noarch/current_repodata.json

错误分析:在镜像网站找不到http://mirrors.bfsu.edu.cn/anaconda/pkgs/free/noarch/current_repodata.json文件

解决办法:删除.condarc文件中所有内容,即关闭所有镜像网站,使用默认路径

17. gcc版本过高

出现报错:error -- unsupported GNU version gcc later than 10 are not supported
解决办法

18. 找不到libcuda.so

如果在执行程序时出现如下报错:

libcuda.so.1: cannot open shared object file: No such file or directory

解决办法1
解决办法2

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嗜睡的篠龙

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值