AttributeError: 'Stream' object has no attribute 'ptr'// CUDA Version Error

File “lib\site-packages\cupy\cuda\stream.py”, line 113, in del
if self.ptr:
AttributeError: ‘Stream’ object has no attribute ‘ptr’

I’ve looked into https://github.com/taolei87/sru/issues/33 to fix it as well but to no avail.
Could anyone advise? Thank you!

The full error is shown here. Why was CUDA activated?

Loaded model en_core_web_sm
Using 20% of accept/reject examples (1176) for evaluation
Traceback (most recent call last):
File “lib\runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "lib\site-packages\prodigy_main
.py", line 254, in
controller = recipe(args, use_plac=True)
File “cython_src\prodigy\core.pyx”, line 152, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File “lib\site-packages\plac_core.py”, line 328, in call
cmd, result = parser.consume(arglist)
File “lib\site-packages\plac_core.py”, line 207, in consume
return cmd, self.func(
(args + varargs + extraopts), **kwargs)
File “C:\Users\AIIC_01\Anaconda3\envs\tf16_gpu\lib\site-packages\prodigy\recipes\ner.py”, line 404, in batch_train
examples = list(split_sentences(model.orig_nlp, examples))
File “cython_src\prodigy\components\preprocess.pyx”, line 36, in split_sentences
File “lib\site-packages\spacy\language.py”, line 540, in pipe
for doc, context in izip(docs, contexts):
File “lib\site-packages\spacy\language.py”, line 564, in pipe
for doc in docs:
File “nn_parser.pyx”, line 366, in pipe
File “cytoolz/itertoolz.pyx”, line 1046, in cytoolz.itertoolz.partition_all.next (cytoolz/itertoolz.c:14538)
for item in self.iterseq:
File “nn_parser.pyx”, line 373, in pipe
File “nn_parser.pyx”, line 399, in spacy.syntax.nn_parser.Parser.parse_batch
File “lib\site-packages\spacy\util.py”, line 244, in get_cuda_stream
return CudaStream() if CudaStream is not None else None
File “lib\site-packages\cupy\cuda\stream.py”, line 110, in init
self.ptr = runtime.streamCreate()
File “cupy/cuda/runtime.pyx”, line 323, in cupy.cuda.runtime.streamCreate
File “cupy/cuda/runtime.pyx”, line 326, in cupy.cuda.runtime.streamCreate
File “cupy/cuda/runtime.pyx”, line 136, in cupy.cuda.runtime.check_status
cupy.cuda.runtime.CUDARuntimeError: cudaErrorInsufficientDriver: CUDA driver version is insufficient for CUDA runtime version
Exception ignored in: <bound method Stream.del of <cupy.cuda.stream.Stream object at 0x0000016A286C2B70>>
Traceback (most recent call last):
File “\lib\site-packages\cupy\cuda\stream.py”, line 113, in del
if self.ptr:
AttributeError: ‘Stream’ object has no attribute ‘ptr’

I’ve tried to code out the cuda parts but it returns me this error:

Loaded model en_core_web_sm
Using 20% of accept/reject examples (1176) for evaluation
Traceback (most recent call last):
File “lib\runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "lib\site-packages\prodigy_main
.py", line 254, in
controller = recipe(args, use_plac=True)
File “cython_src\prodigy\core.pyx”, line 152, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File “lib\site-packages\plac_core.py”, line 328, in call
cmd, result = parser.consume(arglist)
File “lib\site-packages\plac_core.py”, line 207, in consume
return cmd, self.func(
(args + varargs + extraopts), **kwargs)
File “lib\site-packages\prodigy\recipes\ner.py”, line 404, in batch_train
examples = list(split_sentences(model.orig_nlp, examples))
File “cython_src\prodigy\components\preprocess.pyx”, line 36, in split_sentences
File “lib\site-packages\spacy\language.py”, line 540, in pipe
for doc, context in izip(docs, contexts):
File “lib\site-packages\spacy\language.py”, line 564, in pipe
for doc in docs:
File “nn_parser.pyx”, line 366, in pipe
File “cytoolz/itertoolz.pyx”, line 1046, in cytoolz.itertoolz.partition_all.next (cytoolz/itertoolz.c:14538)
for item in self.iterseq:
File “nn_parser.pyx”, line 373, in pipe
File “nn_parser.pyx”, line 399, in spacy.syntax.nn_parser.Parser.parse_batch
AttributeError: module ‘spacy.util’ has no attribute ‘get_cuda_stream’

Apologies, fixed it by downloading and upgrading NVIDIA driver.

Thanks for updating with your solution – glad it’s all working now! :+1: