FFmpeg-Builds icon indicating copy to clipboard operation
FFmpeg-Builds copied to clipboard

whisper: Unsupported GPU (windows)

Open dm-de opened this issue 4 months ago • 10 comments

windows cmd: C:\>ffmpeg -i en.mp3 -filter_complex "whisper=model=ggml-small.bin:language=en" -loglevel debug en.srt

model file is from here: https://huggingface.co/ggerganov/whisper.cpp/tree/main

output:


ffmpeg version N-120845-g0828a3b636-20250829 Copyright (c) 2000-2025 the FFmpeg developers
  built with gcc 15.1.0 (crosstool-NG 1.27.0.79_8f49ec5)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libvmaf --enable-fontconfig --enable-libharfbuzz --enable-libfreetype --enable-libfribidi --enable-vulkan --enable-libshaderc --enable-libvorbis --disable-libxcb --disable-xlib --disable-libpulse --enable-opencl --enable-gmp --enable-lzma --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --enable-libdvdread --enable-libdvdnav --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-libplacebo --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-liboapv --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-libvvenc --enable-whisper --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs=-lgomp --extra-ldflags=-pthread --extra-ldexeflags= --cc=x86_64-w64-mingw32-gcc --cxx=x86_64-w64-mingw32-g++ --ar=x86_64-w64-mingw32-gcc-ar --ranlib=x86_64-w64-mingw32-gcc-ranlib --nm=x86_64-w64-mingw32-gcc-nm --extra-version=20250829
  libavutil      60. 10.100 / 60. 10.100
  libavcodec     62. 13.101 / 62. 13.101
  libavformat    62.  4.101 / 62.  4.101
  libavdevice    62.  2.100 / 62.  2.100
  libavfilter    11.  5.100 / 11.  5.100
  libswscale      9.  2.100 /  9.  2.100
  libswresample   6.  2.100 /  6.  2.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'en.mp3'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument 'whisper=model=ggml-small.bin:language=en'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option 'en.srt' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option filter_complex (create a complex filtergraph) with argument whisper=model=ggml-small.bin:language=en.
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
[AVFilterGraph @ 000002a4b35c5380] Setting 'model' to value 'ggml-small.bin'
[AVFilterGraph @ 000002a4b35c5380] Setting 'language' to value 'en'
[Parsed_whisper_0 @ 000002a4b35a0ac0] whisper_init_from_file_with_params_no_state: loading model from 'ggml-small.bin'
[Parsed_whisper_0 @ 000002a4b35a0ac0] whisper_init_with_params_no_state: use gpu    = 1
[Parsed_whisper_0 @ 000002a4b35a0ac0] whisper_init_with_params_no_state: flash attn = 0
[Parsed_whisper_0 @ 000002a4b35a0ac0] whisper_init_with_params_no_state: gpu_device = 0
[Parsed_whisper_0 @ 000002a4b35a0ac0] whisper_init_with_params_no_state: dtw        = 0
[Parsed_whisper_0 @ 000002a4b35a0ac0] ggml_vulkan: Found 1 Vulkan devices:
[Parsed_whisper_0 @ 000002a4b35a0ac0] ggml_vulkan: 0 = NVIDIA GeForce RTX 4060 (NVIDIA) | uma: 0 | fp16: 1 | bf16: 0 | warp size: 32 | shared memory: 49152 | int dot: 1 | matrix cores: KHR_coopmat
[Parsed_whisper_0 @ 000002a4b35a0ac0] ggml_opencl: selected platform: 'NVIDIA CUDA'
[Parsed_whisper_0 @ 000002a4b35a0ac0]
ggml_opencl: device: 'NVIDIA GeForce RTX 4060 (OpenCL 3.0 CUDA)'
[Parsed_whisper_0 @ 000002a4b35a0ac0] Unsupported GPU: NVIDIA GeForce RTX 4060
[Parsed_whisper_0 @ 000002a4b35a0ac0] ggml_opencl: drop unsupported device.

even, if I add use_gpu=true or use_gpu=false - I geht same error: Unsupported GPU: NVIDIA GeForce RTX 4060

My NVIDIA driver version is 560.94

If this is wrong place for issue - where should I post this?

dm-de avatar Aug 30 '25 12:08 dm-de

That error seems to be coming straight from whisper/ggml, not FFmpeg. Try using vulkan instead of opencl, their OpenCL support is rather incomplete. In any case, if you think this is a bug and they just don't straight up don't support your GPU, you should raise the issue with the whsiper.cpp maintainers.

BtbN avatar Aug 30 '25 12:08 BtbN

Here is only ffmpeg whisper option use_gpu and gpu_device I can not select vulkan.

dm-de avatar Aug 30 '25 12:08 dm-de

Again, you're gonna have to ask the whisper folks on how to select the backend. Maybe FFmpeg needs to forward another option for it. I can't do anything about it at the build-level.

BtbN avatar Aug 30 '25 12:08 BtbN

Maybe FFmpeg needs to forward another option for it

Nor sure, but when I select use_gpu=false - should it work? Here is something in ffmpeg, that forces to check gpu and then fail.

dm-de avatar Aug 30 '25 12:08 dm-de

Not sure what you mean. But really, it's not a bug with the builds. The error is clearly coming from whisper+ggml, so I'd raise the issue there.

BtbN avatar Aug 30 '25 13:08 BtbN

Not sure what you mean

if I use use_gpu=false - I also get same error message and file is not processed:


Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'en.mp3'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument 'whisper=model=ggml-small.bin:language=en:use_gpu=false'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option 'en.srt' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option filter_complex (create a complex filtergraph) with argument whisper=model=ggml-small.bin:language=en:use_gpu=false.
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
[AVFilterGraph @ 00000171ea834900] Setting 'model' to value 'ggml-small.bin'
[AVFilterGraph @ 00000171ea834900] Setting 'language' to value 'en'
[AVFilterGraph @ 00000171ea834900] Setting 'use_gpu' to value 'false'
[Parsed_whisper_0 @ 00000171ea812e80] whisper_init_from_file_with_params_no_state: loading model from 'ggml-small.bin'
[Parsed_whisper_0 @ 00000171ea812e80] whisper_init_with_params_no_state: use gpu    = 0
[Parsed_whisper_0 @ 00000171ea812e80] whisper_init_with_params_no_state: flash attn = 0
[Parsed_whisper_0 @ 00000171ea812e80] whisper_init_with_params_no_state: gpu_device = 0
[Parsed_whisper_0 @ 00000171ea812e80] whisper_init_with_params_no_state: dtw        = 0
[Parsed_whisper_0 @ 00000171ea812e80] ggml_vulkan: Found 1 Vulkan devices:
[Parsed_whisper_0 @ 00000171ea812e80] ggml_vulkan: 0 = NVIDIA GeForce RTX 4060 (NVIDIA) | uma: 0 | fp16: 1 | bf16: 0 | warp size: 32 | shared memory: 49152 | int dot: 1 | matrix cores: KHR_coopmat
[Parsed_whisper_0 @ 00000171ea812e80] ggml_opencl: selected platform: 'NVIDIA CUDA'
[Parsed_whisper_0 @ 00000171ea812e80]
ggml_opencl: device: 'NVIDIA GeForce RTX 4060 (OpenCL 3.0 CUDA)'
[Parsed_whisper_0 @ 00000171ea812e80] Unsupported GPU: NVIDIA GeForce RTX 4060
[Parsed_whisper_0 @ 00000171ea812e80] ggml_opencl: drop unsupported device.
END

dm-de avatar Aug 30 '25 13:08 dm-de

Then you definitely need to report that to the whisper folks.

BtbN avatar Aug 30 '25 13:08 BtbN

@dm-de test with my full build.

If it works (does here), then it's a build issue.

GyanD avatar Sep 06 '25 11:09 GyanD

GyanD build do not work... even less output than BtbN build:

Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'en.mp3'.
Reading option '-filter_complex' ... matched as option 'filter_complex' (create a complex filtergraph) with argument 'whisper=model=ggml-small.bin:language=en:use_gpu=false'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option 'en.srt' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option filter_complex (create a complex filtergraph) with argument whisper=model=ggml-small.bin:language=en:use_gpu=false.
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
[AVFilterGraph @ 000002524acf5bc0] Setting 'model' to value 'ggml-small.bin'
[AVFilterGraph @ 000002524acf5bc0] Setting 'language' to value 'en'
[AVFilterGraph @ 000002524acf5bc0] Setting 'use_gpu' to value 'false'
[Parsed_whisper_0 @ 000002524acf6240] whisper_init_from_file_with_params_no_state: loading model from 'ggml-small.bin'
[Parsed_whisper_0 @ 000002524acf6240] whisper_init_with_params_no_state: use gpu    = 0
[Parsed_whisper_0 @ 000002524acf6240] whisper_init_with_params_no_state: flash attn = 0
[Parsed_whisper_0 @ 000002524acf6240] whisper_init_with_params_no_state: gpu_device = 0
[Parsed_whisper_0 @ 000002524acf6240] whisper_init_with_params_no_state: dtw        = 0
[Parsed_whisper_0 @ 000002524acf6240] ggml_vulkan: Found 1 Vulkan devices:
[Parsed_whisper_0 @ 000002524acf6240] ggml_vulkan: 0 = NVIDIA GeForce RTX 4060 (NVIDIA) | uma: 0 | fp16: 1 | bf16: 0 | warp size: 32 | shared memory: 49152 | int dot: 1 | matrix cores: KHR_coopmat

dm-de avatar Sep 06 '25 11:09 dm-de

Then it looks like an issue with your setup.

Try running it a few times, with both gpu off and on. I've had reports of ffmpeg getting stuck on first run.

GyanD avatar Sep 06 '25 12:09 GyanD