- 我没有接触过算法相关的环境,今天领导让配置下新买的 GPU 服务器,遇到些麻烦
问题
- 我使用 Mini-conda 管理环境,并在虚拟环境中安装了 cuda 、cudnn 、torch 、tf 、paddle 等包
- nvidia-smi 正常工作
- conda list 可以看到 cuda
(nlp) [cs@localhost miniconda3]$ conda list cuda
# packages in environment at /home/cs/miniconda3/envs/nlp:
#
# Name Version Build Channel
cudatoolkit 10.1.243 h6bb024c_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
(nlp) [cs@localhost miniconda3]$ nvcc -v
bash: nvcc: 未找到命令...
- 在 python 里可以使用 torch ,但无法使用 tf 和 paddle
Python 3.7.6 (default, Jan 8 2020, 19:59:22) [GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch >>> >>> print(torch.cuda.is_available())
True >>> import tensorflow as tf >>> >>> print(tf.config.list_physical_devices('GPU'))
[]
可能是环境变量导致的,我应该怎么设置
- torch 可用的原因应该是它内置了 cuda 等,但 tf 和 paddle 需要另外安装,而现在 paddle 和 tf 找不到我安装的 cuda
依赖关系
包 |
版本 |
pytorch |
1.7.1 |
paddle |
1.8.5 |
tf |
2.3 |
cuda |
10.1 |
cudnn |
7.6.5 |
python |
3.7 |