Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

参考install.md 里面配置的环境无法找到cuda #65

Open
JinYu1998 opened this issue Apr 18, 2023 · 13 comments
Open

参考install.md 里面配置的环境无法找到cuda #65

JinYu1998 opened this issue Apr 18, 2023 · 13 comments

Comments

@JinYu1998
Copy link

使用这个 https://github.com/HikariTJU/LD/blob/main/docs/install.md 文件配置的环境, 无法找到cuda呢.

(LD) xx@xx:~/uesrs/xxx_exp$ python
Python 3.7.16 (default, Jan 17 2023, 22:20:44) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
False

如果使用 python tools/train.py configs/ld/ld_r50_gflv1_r101_fpn_coco_1x.py --gpu-ids 5 运行代码, 报错如下:

No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.4'
xxxxx
ImportError: libc10_cuda.so: cannot open shared object file: No such file or directory
@HikariTJU
Copy link
Owner

HikariTJU commented Apr 21, 2023

把mmdet/utils/collect_env.py打印的东西发出来看看
python mmdet/utils/collect_env.py

@JinYu1998
Copy link
Author


(LD) LD-main$ python mmdet/utils/collect_env.py
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.4'
Traceback (most recent call last):
  File "mmdet/utils/collect_env.py", line 15, in <module>
    for name, val in collect_env().items():
  File "mmdet/utils/collect_env.py", line 9, in collect_env
    env_info = collect_base_env()
  File "/home/huasi/miniconda3/envs/LD/lib/python3.7/site-packages/mmcv/utils/env.py", line 85, in collect_env
    from mmcv.ops import get_compiler_version, get_compiling_cuda_version
  File "/home/huasi/miniconda3/envs/LD/lib/python3.7/site-packages/mmcv/ops/__init__.py", line 1, in <module>
    from .bbox import bbox_overlaps
  File "/home/huasi/miniconda3/envs/LD/lib/python3.7/site-packages/mmcv/ops/bbox.py", line 3, in <module>
    ext_module = ext_loader.load_ext('_ext', ['bbox_overlaps'])
  File "/home/huasi/miniconda3/envs/LD/lib/python3.7/site-packages/mmcv/utils/ext_loader.py", line 11, in load_ext
    ext = importlib.import_module('mmcv.' + name)
  File "/home/huasi/miniconda3/envs/LD/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libc10_cuda.so: cannot open shared object file: No such file or directory
                                                                                                                             

@liace369
Copy link

使用这个 https://github.com/HikariTJU/LD/blob/main/docs/install.md 文件配置的环境, 无法找到cuda呢.

(LD) xx@xx:~/uesrs/xxx_exp$ python
Python 3.7.16 (default, Jan 17 2023, 22:20:44) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
False

如果使用 python tools/train.py configs/ld/ld_r50_gflv1_r101_fpn_coco_1x.py --gpu-ids 5 运行代码, 报错如下:

No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.4'
xxxxx
ImportError: libc10_cuda.so: cannot open shared object file: No such file or directory

同学我也遇到这个问题,有解决方法吗?

@JinYu1998
Copy link
Author

使用这个 https://github.com/HikariTJU/LD/blob/main/docs/install.md 文件配置的环境, 无法找到cuda呢.

(LD) xx@xx:~/uesrs/xxx_exp$ python
Python 3.7.16 (default, Jan 17 2023, 22:20:44) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
False

如果使用 python tools/train.py configs/ld/ld_r50_gflv1_r101_fpn_coco_1x.py --gpu-ids 5 运行代码, 报错如下:

No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.4'
xxxxx
ImportError: libc10_cuda.so: cannot open shared object file: No such file or directory

同学我也遇到这个问题,有解决方法吗?

没有, 我放弃了.

@HikariTJU
Copy link
Owner

你们用的什么显卡, nvcc -V 看一下

@JinYu1998
Copy link
Author

你们用的什么显卡, nvcc -V 看一下

GTX 3090 * 8

@liaceyo
Copy link

liaceyo commented Jul 13, 2023

你们用的什么显卡, nvcc -V 看一下

GTX 3090 * 8

我可能找到了问题,install.md中下载pytorch的版本默认是cpu版的,到官网下载对应的cuda版就可以了

@JinYu1998
Copy link
Author

你们用的什么显卡, nvcc -V 看一下

GTX 3090 * 8

我可能找到了问题,install.md中下载pytorch的版本默认是cpu版的,到官网下载对应的cuda版就可以了

我尝试过了, 但是依然失败了.

@JinYu1998
Copy link
Author

你们用的什么显卡, nvcc -V 看一下

GTX 3090 * 8

请问这个问题该如何解决呢?

@HikariTJU
Copy link
Owner

nvcc -V 看一下

@JinYu1998
Copy link
Author

nvcc -V 看一下

$ nvcc -V 
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Wed_Jul_14_19:41:19_PDT_2021
Cuda compilation tools, release 11.4, V11.4.100
Build cuda_11.4.r11.4/compiler.30188945_0

@HikariTJU
Copy link
Owner

我想到了几种方法,你试一下:

  1. 使用pip安装
    pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
  2. 使用docker, repo 提供的dockerfile 我测试过在A100上是可用

@JinYu1998
Copy link
Author

我想到了几种方法,你试一下:

  1. 使用pip安装
    pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
  2. 使用docker, repo 提供的dockerfile 我测试过在A100上是可用

非常感谢您的回复, 我已经解决了这个问题.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants