【发布时间】:2020-09-29 09:21:09
【问题描述】:
我已经设置了所有安装在我的虚拟机上的需求包,我发现没有安装 nvidia GPU 驱动程序,在需求中没有 nvidia GPU 驱动程序安装说明,我想知道哪个 cuda 版本和它兼容需要哪个 nvidia 驱动程序也解决以下错误。
Github 链接:github
错误日志:
File "run_ner.py", line 594, in <module>
main()
File "run_ner.py", line 489, in main
loss = model(input_ids, segment_ids, input_mask, label_ids,valid_ids,l_mask)
File "/home/pt3_gcp/BERT-NER/ber_ner/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__
result = self.forward(*input, **kwargs)
File "run_ner.py", line 35, in forward
valid_output = torch.zeros(batch_size,max_len,feat_dim,dtype=torch.float32,device='cuda')
File "/home/pt3_gcp/BERT-NER/ber_ner/lib/python3.7/site-packages/torch/cuda/__init__.py", line 178, in _lazy_init
_check_driver()
File "/home/pt3_gcp/BERT-NER/ber_ner/lib/python3.7/site-packages/torch/cuda/__init__.py", line 99, in _check_driver
http://www.nvidia.com/Download/index.aspx""")
AssertionError:
**Found no NVIDIA driver on your system. Please check that you
have an NVIDIA GPU and installed a driver from
http://www.nvidia.com/Download/index.aspx
**
从以下链接安装最新的 cuda 版本后, cuda我收到以下错误,
06/04/2020 07:38:40 - INFO - __main__ - ***** Running training *****
06/04/2020 07:38:40 - INFO - __main__ - Num examples = 14041
06/04/2020 07:38:40 - INFO - __main__ - Batch size = 32
06/04/2020 07:38:40 - INFO - __main__ - Num steps = 2190
Epoch: 0%| | 0/5 [00:00<?, ?it/sTHCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=50 error=38 : no CUDA-capable device is detectedt/s]
Traceback (most recent call last):
File "run_ner.py", line 594, in <module>
main()
File "run_ner.py", line 489, in main
loss = model(input_ids, segment_ids, input_mask, label_ids,valid_ids,l_mask)
File "/home/pt3_gcp/.local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__
result = self.forward(*input, **kwargs)
File "run_ner.py", line 35, in forward
valid_output = torch.zeros(batch_size,max_len,feat_dim,dtype=torch.float32,device='cuda')
File "/home/pt3_gcp/.local/lib/python3.7/site-packages/torch/cuda/__init__.py", line 179, in _lazy_init
torch._C._cuda_init()
RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:50
【问题讨论】:
-
安装Nvidia驱动后是否重启过虚拟机?
-
@MichaelJungo 是的
-
@MichaelJungo 从 sudo apt-get install cuda-driver-440 安装最新的 cuda 驱动程序时是否会出现此错误?或者哪个驱动版本更可取?
-
$ nvidia-smi NVIDIA-SMI 失败,因为它无法与 NVIDIA 驱动程序通信。确保已安装并运行最新的 NVIDIA 驱动程序。
-
是的,试过了,但还是一样,$ nvidia-smi NVIDIA-SMI 失败了,因为它无法与 NVIDIA 驱动程序通信。确保已安装并运行最新的 NVIDIA 驱动程序。
标签: pytorch named-entity-recognition huggingface-transformers bert-language-model