#8761 Error during speech recognition stage[faster-whisper(Built-in)] parallel_for failed: cudaErrorInvalidDevice: invalid dev

108.198**8 Posted at: 14 minutes ago

Error during speech recognition stage[faster-whisper(Built-in)] parallel_for failed: cudaErrorInvalidDevice: invalid device ordinal:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 139, in faster_whisper
File "faster_whisper\transcribe.py", line 1851, in restore_speech_timestamps
File "faster_whisper\transcribe.py", line 1190, in generate_segments
File "faster_whisper\transcribe.py", line 1400, in encode
RuntimeError: parallel_for failed: cudaErrorInvalidDevice: invalid device ordinal

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 84, in run
File "videotrans\task\_stage_recogn.py", line 64, in recogn
File "videotrans\recognition\__init__.py", line 148, in run
File "videotrans\recognition\_base.py", line 101, in run
File "videotrans\recognition\_whisper.py", line 39, in _exec
File "videotrans\recognition\_whisper.py", line 136, in _faster
File "videotrans\configure\base.py", line 291, in _new_process
videotrans.configure.excepts.VideoTransError: parallel_for failed: cudaErrorInvalidDevice: invalid device ordinal:Traceback (most recent call last):
File "videotrans\process\stt_faster.py", line 139, in faster_whisper
File "faster_whisper\transcribe.py", line 1851, in restore_speech_timestamps
File "faster_whisper\transcribe.py", line 1190, in generate_segments
File "faster_whisper\transcribe.py", line 1400, in encode
RuntimeError: parallel_for failed: cudaErrorInvalidDevice: invalid device ordinal

trk=Translation V/A 单视频模式
Select Media File: G:/Movies/Audials Other Videos/BB Convert to English/Babylon Berlin - Folge 1 · Staffel 5 _ Babylon Be_ier anschauen_2.mp4,
Output Directory: G:/Movies/Audials Other Videos/BB Convert to English/_video_out/Babylon Berlin - Folge 1 · Staffel 5 _ Babylon Be_ier anschauen_2-mp4,
self.cfg.cache_folder='D:/Downloads/win-pyvideotrans-v4.18/tmp/9680/9d6d5dd3dd'
Selected Clear Output, Selected Enable CUDA
STT Service:faster-whisper(Built-in), large-v3-turbo, Spoken: German
Max Speech Duration (s): 5s
Min Speech Duration (ms): 3000ms
Min Silence Duration for Split (ms): 600ms
VAD Speech Threshold: 0.45
VAD Engine: silero
Compute Type:default
Beam Size:5
Best Of:5
Condition on Previous Text:False
Repetition Penalty:1.0
Compression Ratio Threshold:2.4
TranslateSrt:Google Translate (Free),Spoken:German,Target:English
Traditional Translation Batch Size (Lines): 5
Dont dubbing: self.cfg.voice_role='No'
Hard Subtitles
Max Line Length (CJK Characters):15, Max Line Length (Non-CJK):40
Selected Output MP4 Only
video duration:2304866ms
video information:{'video_fps': 50.0, 'r_frame_rate': 50.0, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 1280, 'height': 720, 'time': 2304866, 'streams_len': 3, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}
self.cfg=TaskCfgVTT(uuid='9d6d5dd3dd', name='G:/Movies/Audials Other Videos/BB Convert to English/Babylon Berlin - Folge 1 · Staffel 5 Babylon Be_ier anschauen_2.mp4', dirname='G:/Movies/Audials Other Videos/BB Convert to English', noextname='Babylon Berlin - Folge 1 · Staffel 5 Babylon Be_ier anschauen_2', basename='Babylon Berlin - Folge 1 · Staffel 5 Babylon Be_ier anschauen_2.mp4', ext='mp4', target_dir='G:/Movies/Audials Other Videos/BB Convert to English/_video_out/Babylon Berlin - Folge 1 · Staffel 5 Babylon Be_ier anschauen_2-mp4', cache_folder='D:/Downloads/win-pyvideotrans-v4.18/tmp/9680/9d6d5dd3dd', is_cuda=True, source_language='German', source_language_code='de', source_sub='G:/Movies/Audials Other Videos/BB Convert to English/_video_out/Babylon Berlin - Folge 1 · Staffel 5 Babylon Be_ier anschauen_2-mp4/de.srt', source_wav='D:/Downloads/win-pyvideotrans-v4.18/tmp/9680/9d6d5dd3dd/de.wav', source_wav_output='G:/Movies/Audials Other Videos/BB Convert to English/_video_out/Babylon Berlin - Folge 1 · Staffel 5 Babylon Be_ier anschauen_2-mp4/de.m4a', target_language='English', target_language_code='en', target_sub='G:/Movies/Audials Other Videos/BB Convert to English/_video_out/Babylon Berlin - Folge 1 · Staffel 5 Babylon Be_ier anschauen_2-mp4/en.srt', target_wav='D:/Downloads/win-pyvideotrans-v4.18/tmp/9680/9d6d5dd3dd/target.wav', target_wav_output='G:/Movies/Audials Other Videos/BB Convert to English/_video_out/Babylon Berlin - Folge 1 · Staffel 5 Babylon Be_ier anschauen_2-mp4/en.m4a', translate_type=0, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', voice_autorate=True, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, detect_language='de', recogn_type=0, model_name='large-v3-turbo', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=False, fix_punc=0, app_mode='biaozhun', subtitle_language=None, targetdir_mp4='G:/Movies/Audials Other Videos/BB Convert to English/_video_out/Babylon Berlin - Folge 1 · Staffel 5 Babylon Be_ier anschauen_2-mp4/Babylon Berlin - Folge 1 · Staffel 5 Babylon Be_ier anschauen_2.mp4', novoice_mp4='D:/Downloads/win-pyvideotrans-v4.18/tmp/9680/9d6d5dd3dd/novoice.mp4', is_separate=False, embed_bgm=True, instrument='D:/Downloads/win-pyvideotrans-v4.18/tmp/9680/9d6d5dd3dd/instrument.wav', vocal='D:/Downloads/win-pyvideotrans-v4.18/tmp/9680/9d6d5dd3dd/vocal.wav', clear_cache=True, background_music='', subtitle_type=1, only_out_mp4=True, recogn2pass=False, output_srt=0, copysrt_rawvideo=False, loop_backaudio=1, backaudio_volume=0.8, batch=False)
video_duration_ms=2304866


=
system:Windows-10-10.0.19045-SP0
version:v4.18
frozen:True
language:en_US
root_dir:D:/Downloads/win-pyvideotrans-v4.18

1 Replies

#1 DeepSeek reply at 14 minutes ago

This error is caused by the CUDA device not being found. You enabled Enable CUDA, but the program cannot obtain a valid NVIDIA GPU device index. Common causes are: the computer has no NVIDIA GPU, the NVIDIA driver is too old, CUDA 12.8 / cuDNN 9 is not properly installed, or the GPU index is incorrect on a multi-GPU machine.

Solution (try in order):

  1. First uncheck Enable CUDA on the main interface and rerun. If it works, the problem is purely the CUDA environment, not the video or the model.
  2. If you want to keep GPU acceleration: update the NVIDIA driver to the latest version, confirm that CUDA 12.8 and cuDNN 9.11 are installed, and add the bin and lib directories of cuDNN to the system Path. AMD/Intel GPUs do not support CUDA acceleration and must be used with CUDA disabled.
  3. After GPU is enabled, if the error persists, open Menu → Tools/Options → Advanced Options → Speech Recognition (ASR) and change Compute Type from default to float16. If it still fails, change it to int8. Also lower Beam Size and Best Of from 5 to 1 to reduce VRAM usage.
  4. If you have multiple GPUs or integrated graphics plus a discrete GPU, the software may have selected the wrong device. Update to the latest version (v4.18 and later support automatic selection of the high-performance GPU with the most available VRAM). If that is not possible, disable the integrated GPU, or set the NVIDIA discrete GPU as the default for this program in the NVIDIA Control Panel.
  5. If GPU acceleration still fails after the steps above, keep CUDA disabled, use large-v3-turbo to run on CPU, and rely on Max Speech Duration / Min Speech Duration to control segmentation.

Additional note: the video path contains a special character (·) and spaces (for example Folge 1 · Staffel 5). Although it did not cause this error, ffmpeg errors are likely later. It is recommended to rename the file to a short all-English name (for example bb_s05e01.mp4) and move it to a shallow directory before retrying.

Please refer to the related documentation:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource