#8350 parallel_for failed: cudaErrorInvalidDevice: invalid device ordinal:Traceback (most recent call last): File

2a12**8b45 Posted at: 1 hour ago

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 71, in run
File "videotrans\task\_stage_recogn.py", line 63, in recogn
File "videotrans\recognition\__init__.py", line 141, 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 277, 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=[TransCreate]: uuid='e7485f5ccc', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: E:/Video_content/Shorts/rubycon_capacity-short-ru.mp4,
输出结果保存到文件夹: E:/Video_content/Shorts/_video_out/rubycon_capacity-short-ru-mp4,
临时文件夹: H:/TorrentDownloads/PyVideoTrans/tmp/50332/e7485f5ccc
已选 清理已存在
已启用CUDA加速
未选 降噪
STT Service:faster-whisper(Built-in), large-v3-turbo, 发音语言: Russian,
TranslateSrt:Google Translate (Free),原始语言:Russian,目标语言:English, 已选 SendSRT
TTS Service:Edge-TTS (Free), 角色:Eric(Male/US), 配音语言:English, 已选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: Soft Subtitles , precent=4, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=True, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='', should_recogn2=True, do_diarize=True
video_duration_ms=171486


=
system:Windows-10-10.0.19044-SP0
version:v4.16
frozen:True
language:en_US
root_dir:H:/TorrentDownloads/PyVideoTrans

1 Replies

#1 DeepSeek reply at 1 hour ago

The root cause is the CUDA device index: EnabledCUDA is checked, but the CUDA runtime cannot find a usable NVIDIA device at that ordinal. The software launched faster-whisper on a GPU that is not visible or not valid in the current environment (no NVIDIA card, unsupported/old driver, CUDA_VISIBLE_DEVICES mismatch, or a GPU detection/binding issue).

Steps to fix:

  1. Verify the GPU is actually visible: open CMD and run nvidia-smi and nvcc -V. A valid result must show an NVIDIA card and CUDA 12.8 (or 12.8+).
  2. If no NVIDIA card / no CUDA installed / driver too old, uncheck Enable CUDA? on the main window and rerun (CPU mode). This is the immediate workaround.
  3. If CUDA is installed: update the NVIDIA driver to the latest version, confirm cuDNN 9.11+ is present, and confirm the CUDA bin and lib directories are in the system Path.
  4. Check Advanced Options -> General -> Number of GPU tasks[restart] and set it to 1, then fully restart the software.
  5. If a CUDA_VISIBLE_DEVICES environment variable is set (e.g. to a nonexistent index), clear it or set it to 0.
  6. Re-run with Clean Generated checked so the failed partial cache is discarded.

If the error persists after confirming nvidia-smi works, provide the last ~30 lines of the newest file in the software logs/ directory plus the output of nvidia-smi for further analysis.

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