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

文章目录

  • 1、GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
  • 2、安装tree
  • 3、查询GPU时无进程运行,但是显存却被占用了
  • 4、VScode无法显示GUI图像
  • 5、Linux中的软硬连接
  • 6、VSCODE无法打开web视图,“Webview Service Worker Error in registration due to invalid document state”
  • 7、切换CUDA版本
  • 8、GPU对应算力
  • 9、CUDA和显卡算力不匹配
  • 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))
  • 12、NVIDIA驱动重装导致cuda版本不匹配

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环境(重开)

你可能感兴趣的:(又怎么不能解决呢?,解决问题,小确幸)