Enable GPU for Spacy

658 Views Asked by At

I'm trying to set up a GPU to train models using Spacy

I've configured a docker container with GPU and it seems like it can be seen from Pytorch enter image description here

Following the spacy site, to enable GPU I run the command

pip install -U 'spacy[cuda-autodetect]' 

It fails saying it doesn't detect CUDA

enter image description here

If I run the PyTorch collect_env script this is what I get enter image description here

If I don't try to install this library and run spacy.prefer_gpu I get a False

I'm not sure what could be missing

As a side note, I can use the GPU with other libraries like transformers

enter image description here

1

There are 1 best solutions below

0
Kipras Kančys On

Try spacy.require_gpu() which provides information why gpu is not available. For example:

enter image description here