ValueError: GPU is not accessible. Was the library installed correctly?
I installed spacy 3 in a venv and tried to execute:
spacy.require_gpu()
Then I got this as output:
>>> spacy.require_gpu()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.virtualenvs/spacy3/lib/python3.8/site-packages/thinc/util.py", line 187, in require_gpu
raise ValueError("GPU is not accessible. Was the library installed correctly?")
ValueError: GPU is not accessible. Was the library installed correctly?
How can I get rid of this?
Im using:
nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.119.04 Driver Version: 450.119.04 CUDA Version: 11.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. 695
ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce GTX 166... Off | 00000000:01:00.0 Off | N/A |
| N/A 43C P8 1W / N/A | 11MiB / 5944MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1493 G /usr/lib/xorg/Xorg 4MiB |
| 0 N/A N/A 1919 G /usr/lib/xorg/Xorg 4MiB |
+-----------------------------------------------------------------------------+
nvcc -version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85
spacy version
'3.1.0'
Python version
3.8
Installed spacy using :
pip install -U spacy[cuda110]
Selected driver details
When trying to import cupy, it shows this error:
>>> import cuda
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cuda'
>>> import cupy
Traceback (most recent call last):
File "/home/user/.virtualenvs/spacy3/lib/python3.8/site-packages/cupy/__init__.py", line 15, in <module>
from cupy import core # NOQA
File "/home/user/.virtualenvs/spacy3/lib/python3.8/site-packages/cupy/core/__init__.py", line 1, in <module>
from cupy.core import core # NOQA
ImportError: libcublas.so.11: cannot open shared object file: No such file or directory
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.virtualenvs/spacy3/lib/python3.8/site-packages/cupy/__init__.py", line 36, in <module>
raise ImportError(_msg) from e
ImportError: CuPy is not correctly installed.
If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host.
Also, confirm that only one CuPy package is installed:
$ pip freeze
If you are building CuPy from source, please check your environment, uninstall CuPy and reinstall it with:
$ pip install cupy --no-cache-dir -vvvv
Check the Installation Guide for details:
https://docs.cupy.dev/en/latest/install.html
original error: libcublas.so.11: cannot open shared object file: No such file or directory
But while installing spacy it showed cupy like this:
Successfully installed MarkupSafe-2.0.1 blis-0.7. 695