KoljaB / RealtimeSTT

A robust, efficient, low-latency speech-to-text library with advanced voice activity detection, wake word activation and instant transcription.
MIT License
2.09k stars 190 forks source link

Cuda Error #49

Closed jared-visionbox closed 7 months ago

jared-visionbox commented 7 months ago

Followed the installation steps to run the repo. When I try running realtimestt_test.py, I get this runtime error:

root - ERROR - Unhandled exeption in _realtime_worker: parallel_for failed: cudaErrorNoKernelImageForDevice: no kernel image is available for 
execution on the device
Exception in thread Thread-3:
Traceback (most recent call last):
  File "C:\Users\uber_\AppData\Local\Programs\Python\Python39\lib\threading.py", line 973, in _bootstrap_inner
    self.run()
  File "C:\Users\uber_\AppData\Local\Programs\Python\Python39\lib\threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "C:\VisionBox\NLP\transcription_translation\.venv\lib\site-packages\RealtimeSTT\audio_recorder.py", line 1302, in _realtime_worker
    self.realtime_transcription_text = " ".join(
  File "C:\VisionBox\NLP\transcription_translation\.venv\lib\site-packages\RealtimeSTT\audio_recorder.py", line 1302, in <genexpr>       
    self.realtime_transcription_text = " ".join(
  File "C:\VisionBox\NLP\transcription_translation\.venv\lib\site-packages\faster_whisper\transcribe.py", line 511, in generate_segments 
    encoder_output = self.encode(segment)
  File "C:\VisionBox\NLP\transcription_translation\.venv\lib\site-packages\faster_whisper\transcribe.py", line 762, in encode
    return self.model.encode(features, to_cpu=to_cpu)
RuntimeError: parallel_for failed: cudaErrorNoKernelImageForDevice: no kernel image is available for execution on the device
Traceback (most recent call last):
    recorder.text(process_text)
  File "C:\VisionBox\NLP\transcription_translation\.venv\lib\site-packages\RealtimeSTT\audio_recorder.py", line 882, in text
    self.wait_audio()
  File "C:\VisionBox\NLP\transcription_translation\.venv\lib\site-packages\RealtimeSTT\audio_recorder.py", line 802, in wait_audio
    if (self.stop_recording_event.wait(timeout=0.02)):

I confirmed that Cuda 11.8 is installed using: nvcc -V and have the cuDNN (8.7.0) files as well. Torch is also available.

KoljaB commented 7 months ago

Not sure but maybe graphics card is not supported by current torch anymore? In the link is mentioned that even torch.is_available() might return true although it can fail then.

KoljaB commented 7 months ago

You can check compatibility here: https://developer.nvidia.com/cuda-gpus

If not supported it still may be possible to compile pytorch for yourself.

jared-visionbox commented 7 months ago

I have a NVIDIA Quadro M1200. Compute Capability 5.0.

Running this command: python -c "import torch; print(torch.cuda.get_arch_list())" I can see that compute_37. Does this mean that a compute capability of 3.7 is required?

jared-visionbox commented 7 months ago

Not sure if this would be helpful but here are the output when I input command: python -m torch.utils.collect_env

Collecting environment information...
PyTorch version: 2.2.2+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 10 Pro
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.19045-SP0
Is CUDA available: True
CUDA runtime version: 11.8.89
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: Quadro M1200
Nvidia driver version: 536.45
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture=9
CurrentClockSpeed=2701
Family=198
L2CacheSize=1024
L2CacheSpeed=
Manufacturer=GenuineIntel
MaxClockSpeed=2701
Name=Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
ProcessorType=3
Revision=24067

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] onnxruntime==1.17.3
[pip3] torch==2.2.2+cu118
[pip3] torchaudio==2.2.2
[conda] Could not collect
KoljaB commented 7 months ago

This is beyond the scope if this lib and belongs to the torch forum. Another user with the same problem and the same graphics card: https://discuss.pytorch.org/t/cudacheckerror-failed-no-kernel-image-is-available-for-execution-on-the-device/25026

jared-visionbox commented 7 months ago

Thanks, will take a look at those resources!

KoljaB commented 7 months ago

Maybe cuDNN 9.1.0 is worth a try