Windows Crash on Exit (0xC0000409 in ucrtbase.dll) Post-Transcription with faster-whisper 1.1.1
Environment: OS: Windows 10 Pro Python: 3.12.3 GPU: NVIDIA GeForce RTX 4070 Ti SUPER (16GB VRAM) NVIDIA Driver Version: 560.94 PyTorch: torch==2.5.1+cu121 cuDNN Version (detected by PyTorch): 9.1.0 (torch.backends.cudnn.version() returns 90100) (Initial) Cuda toolkit on disk: 11.8 Input File (video file) : YouTube ID kOuih-vbAt4
system specs: 128GB RAM 16GB VRAM AMD RYZEN 9 7900x3D
During test, the Whisper Model barely uses 4GB of VRAM, I was checking this via process monitor.
Version Testing Results: faster-whisper==1.1.1 + ctranslate2==4.6.0 => CRASHES on GPU cleanup faster-whisper==1.0.0 + ctranslate2==4.6.0 => WORKS correctly faster-whisper==1.0.0 + ctranslate2==4.0.0 => WORKS correctly
Description: When using faster-whisper v1.1.1 with GPU acceleration (device="cuda") on Windows, the Python process crashes reliably after successfully completing a transcription task. The crash occurs during process exit or when the WhisperModel object is explicitly deleted (del model), not during the transcription itself. The crash manifests as a Windows application crash with: Exit Code: -1073740791 (0xC0000409 - STATUS_STACK_BUFFER_OVERRUN) Faulting Modules (Event Log): ucrtbase.dll, KERNELBASE.dll (Exception code 0xe06d7363) This crash does not occur when using the older faster-whisper==1.0.0, even when paired with the same ctranslate2==4.6.0 version that crashes under faster-whisper==1.1.1.
Furthermore, forcing transcription to run on the CPU (device="cpu") completely avoids the crash, regardless of the faster-whisper / ctranslate2 version combination.
Steps to Reproduce:
- Set up the environment as specified above.
- Install the crashing combination: pip install faster-whisper==1.1.1 ctranslate2==4.6.0
- Create a minimal Python script that:
- Imports faster_whisper.WhisperModel.
- Loads a Whisper model (e.g., "medium.en") onto the GPU: model = WhisperModel(model_size, device="cuda").
- Transcribes a reasonably long audio file (e.g., YouTube ID kOuih-vbAt4 which is >30 mins): segments, info = model.transcribe("path/to/audio.mp4", word_timestamps=True).
- Optionally, include del model before the script ends to trigger the crash explicitly.
- Allow the script to finish.
- Run the script.
Expected Behavior: The script completes transcription and exits cleanly with code 0.
Actual Behavior: Transcription completes, but the process crashes during cleanup/exit with code 0xC0000409
UPDATE: seems that the lower version only hides the problem better, as with another video which is longer and has more words, the problem happens again -> example YT Id: 8xpyOSJaxkA (downloaded from YT as example). also from what I have seen / double checked with other tickets , this issue might be a duplicate of https://github.com/SYSTRAN/faster-whisper/issues/71
Update2 Current workaround YT Id: 8xpyOSJaxkA (video that has more words) -> Works with this exact combination-> CUDA Toolkit 12.1 NVIDIA Driver 576.02 cuDNN 9.1.0 torch==2.5.1+cu121 faster-whisper==1.1.1 ctranslate2==4.6.0
Update3 By now, i have tested a broad range of CUDA toolkits + drivers + CUDNN version combinations. Some versions crash with a 30min audio , other versions work with 35 min audio, but crash with longer audio. There is also a problem in the driver compatibility i think , related to what actually comes bundled in the CUDA Toolkit, VS what NVidia drivers you actually have installed -> to fix this, just uninstall your drivers and let the CUDA Toolkit manage your drivers, most likely they are tested together when released. For now, I had the most successful runs with longer audio files and no crashes yet with the following packages: pip modules (used bundled CUDNN that come in the torch package)
torch 2.6.0+cu126
torchaudio 2.6.0+cu126
torchvision 0.21.0+cu126
faster-whisper 1.1.1
ctranslate2 4.6.0nvidia related:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Fri_Jun_14_16:44:19_Pacific_Daylight_Time_2024
Cuda compilation tools, release 12.6, V12.6.20
Build cuda_12.6.r12.6/compiler.34431801_0
-> downloaded this cuda_12.6.0_560.76_windows.exeThe above combination passes most audio samples, but still crashes on some longer ones, so basically this last combination was the most successful without any hacks.
So, for now i just implement the workaround with a separate process and currently handling errors in another way based on what files i have on disk, this is a hack... and not an elegant solution to this problem ( link to suggestion https://github.com/SYSTRAN/faster-whisper/issues/71#issuecomment-1526144389 ) .
Ticket can be closed IMO, from my side it's enough info to maybe help anyone else who might encounter this problem.
Source: SYSTRAN/faster-whisper