#4122 faster-whisper不能CUDA

182.105* Posted at: 3 hours ago 👁12

faster-whisper不能CUDA,始终是CPU在跑

3 Replies

这是由于CUDA环境未正确配置或软件未启用GPU加速导致的。

解决方案

  1. 确认CUDA安装:在CMD中输入 nvcc -Vnvidia-smi,确认已安装CUDA 12.8版本且显卡支持CUDA。
  2. 检查软件设置:在pyVideoTrans主界面右上角,确保已勾选 CUDA加速 复选框。
  3. 验证环境变量:检查系统环境变量 PATH 是否包含CUDA的 binlib 目录(例如 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin)。
  4. 更新显卡驱动:将NVIDIA显卡驱动更新至最新版本。
  5. 检查模型兼容性:确保使用的 faster-whisper 模型(如 large-v3)支持CUDA加速。

如果以上步骤均确认无误但问题依旧,可能是软件未能正确检测到CUDA环境。请提供软件 logs 目录下最新日志文件的底部约30行报错信息,以便进一步分析。

请查阅相关文档:


Application started at 2026-04-17 22:04:43

First searching GPU...
[DEBUG] 返回缓存的编解码器 Windows-264: h264_nvenc
[DEBUG] 返回缓存的编解码器 Windows-265: hevc_nvenc
NVIDIA_GPU_NUMS=1
Found 1 GPUs, cost=1s
start workers...
process_max_gpu=1
multi_gpus=False
Concurrent task_nums=1
process_max=1
start 9 jobs
ended workers
[DEBUG] 最终配置信息:self.cfg=TaskCfgVTT(is_cuda=True, uuid='605e687e0b', cache_folder='D:/videotrans/tmp/16656/605e687e0b', target_dir='E:/manju/新建文件夹/_video_out/1-mp4', source_language='简体中文', source_language_code='zh-cn', source_sub='E:/manju/新建文件夹/_video_out/1-mp4/zh-cn.srt', source_wav='D:/videotrans/tmp/16656/605e687e0b/zh-cn.wav', source_wav_output='E:/manju/新建文件夹/_video_out/1-mp4/zh-cn.m4a', target_language='越南语', target_language_code='vi', target_sub='E:/manju/新建文件夹/_video_out/1-mp4/vi.srt', target_wav='D:/videotrans/tmp/16656/605e687e0b/target.wav', target_wav_output='E:/manju/新建文件夹/_video_out/1-mp4/vi.m4a', name='E:/manju/新建文件夹/1.mp4', noextname='1', basename=
......
tions.ConnectTimeoutError: (, 'Connection to translate.google.com timed out. (connect timeout=5)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "requests\adapters.py", line 644, in send
File "urllib3\connectionpool.py", line 841, in urlopen
File "urllib3\util\retry.py", line 519, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='translate.google.com', port=443): Max retries exceeded with url: / (Caused by ConnectTimeoutError(, 'Connection to translate.google.com timed out. (connect timeout=5)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\translator\__init__.py", line 899, in _check_google
File "requests\api.py", line 100, in head
File "requests\api.py", line 59, in request
File "requests\sessions.py", line 589, in request
File "requests\sessions.py", line 703, in send
File "requests\adapters.py", line 665, in send
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='translate.google.com', port=443): Max retries exceeded with url: / (Caused by ConnectTimeoutError(, 'Connection to translate.google.com timed out. (connect timeout=5)'))
[WARNING] ==未设置代理并且检测google失败,使用微软翻译
[WARNING] ==未设置代理并且检测google失败,使用微软翻译
self.trans_thread=10,self.aisendsrt=False,self.translate_type=0
[INFO] Starting call to 'videotrans.translator._microsoft.Microsoft._item_task', this is the 1st time calling it.
[DEBUG] [Mircosoft]返回:response=
[INFO] Starting call to 'videotrans.translator._microsoft.Microsoft._item_task', this is the 1st time calling it.
[DEBUG] [Mircosoft]返回:response=
[INFO] Starting call to 'videotrans.translator._microsoft.Microsoft._item_task', this is the 1st time calling it.
[DEBUG] [Mircosoft]返回:response=
[INFO] Starting call to 'videotrans.translator._microsoft.Microsoft._item_task', this is the 1st time calling it.
[DEBUG] [Mircosoft]返回:response=
[INFO] Starting call to 'videotrans.translator._microsoft.Microsoft._item_task', this is the 1st time calling it.
[DEBUG] [Mircosoft]返回:response=
[INFO] Starting call to 'videotrans.translator._microsoft.Microsoft._item_task', this is the 1st time calling it.
[DEBUG] [Mircosoft]返回:response=
[INFO] Starting call to 'videotrans.translator._microsoft.Microsoft._item_task', this is the 1st time calling it.
[DEBUG] [Mircosoft]返回:response=
[INFO] Starting call to 'videotrans.translator._microsoft.Microsoft._item_task', this is the 1st time calling it.
[DEBUG] [Mircosoft]返回:response=
[INFO] Starting call to 'videotrans.translator._microsoft.Microsoft._item_task', this is the 1st time calling it.
[DEBUG] [Mircosoft]返回:response=
[DEBUG] 以普通文本行按行翻译:原始行数:88,翻译后行数:88
[DEBUG] [字幕翻译]渠道0,:共耗时:19s
[DEBUG] omnivoice-tts ref_aud='D:/videotrans/f5-tts/男配音.wav',ref_text='可以选择出售自己的寿命来换取财富,只要他们愿意捐赠给富有的人十五年寿命,就可以轻松获得七十万欧元,在这个未来世界,贫穷的人'
Loaded as API: http://127.0.0.1:8081/
[DEBUG] [字幕配音]渠道2:共耗时:2s

日志显示 is_cuda=True,说明软件已启用CUDA加速。但日志中未包含faster-whisper语音识别阶段的详细输出,无法直接判断CUDA是否被调用。问题可能在于CUDA环境不兼容或软件内部调用异常。

解决方案:

  1. 验证CUDA环境:在CMD中运行 nvcc -V 确认CUDA版本为12.8,运行 nvidia-smi 确认显卡驱动正常且支持CUDA。
  2. 检查高级选项:在软件中点击 菜单 -> 工具/选项 -> 高级选项,在“语音识别参数”区域,确认 CUDA数据类型 设置为 float16default,而非 int8
  3. 查看完整日志:日志中缺少语音识别(ASR)阶段的关键信息。请重新运行一次视频翻译任务,并在任务开始后,立即打开软件根目录下的 logs 文件夹,找到最新的日志文件,复制其中包含 faster-whisperwhisper 字样的行(特别是任务初期部分),以便分析CUDA加载状态。
  4. 尝试其他模型:暂时将语音识别模型从 large-v3 切换为 mediumsmall,以排除因模型过大导致CUDA初始化失败的可能。

如果问题依旧,请提供包含语音识别阶段详细输出的日志片段。

请查阅相关文档:

Post Your Reply
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.

Related resource