小编pal*_*ion的帖子

重新启动 DLVM 后无法通过 Tensorflow/Pytorch 检测 GPU

这个问题发生在我今天重新启动我的云笔记本服务器时。可以使用以下步骤重现:

  1. 使用 Tensorflow 或 Pytorch 和 GPU 创建 Google Cloud Notebook 服务器

  2. 启动服务器后,打开python控制台:

>>> import torch
>>> torch.cuda.is_available()
True
Run Code Online (Sandbox Code Playgroud)

CUDA 设备目前可用。

  1. 重启服务器,再次打开笔记本。
>>> import torch
>>> torch.cuda.is_available()
/opt/conda/lib/python3.7/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at  /opt/conda/conda-bld/pytorch_1614378098133/work/c10/cuda/CUDAFunctions.cpp:109.)
  return torch._C._cuda_getDeviceCount() > 0
False
Run Code Online (Sandbox Code Playgroud)

nvidia-smi 命令工作正常。

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.80.02    Driver Version: 450.80.02    CUDA Version: …
Run Code Online (Sandbox Code Playgroud)

google-cloud-platform pytorch google-dl-platform gcp-ai-platform-notebook

5
推荐指数
1
解决办法
478
查看次数