Voice recognition works with CPU, but not GPU.
Hi there!
I am playing with the voice recognition of Kdenlive, and it works really well when I run it on the CPU. If I use the GPU, it looks like it goes off and processes, but makes no subtitles.
It posts no error, but it did give this log file:
Traceback (most recent call last):
File "/usr/share/kdenlive/scripts/whispertosrt.py", line 54, in <module>
sys.exit(main())
^^^^^^
File "/usr/share/kdenlive/scripts/whispertosrt.py", line 33, in main
result = whispertotext.run_whisper(source, model, device, task, language)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/kdenlive/scripts/whispertotext.py", line 53, in run_whisper
model = whisper.load_model(model, device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/whisper/__init__.py", line 154, in load_model
return model.to(device)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1145, in to
return self._apply(convert)
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/torch/nn/modules/module.py", line 797, in _apply
module._apply(fn)
File "/usr/lib/python3.11/site-packages/torch/nn/modules/module.py", line 797, in _apply
module._apply(fn)
File "/usr/lib/python3.11/site-packages/torch/nn/modules/module.py", line 797, in _apply
module._apply(fn)
[Previous line repeated 2 more times]
File "/usr/lib/python3.11/site-packages/torch/nn/modules/module.py", line 820, in _apply
param_applied = fn(param)
^^^^^^^^^
File "/usr/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1143, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 26.00 MiB (GPU 0; 7.75 GiB total capacity; 7.23 GiB already allocated; 16.81 MiB free; 7.58 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
Right, so reading that log file, it appears that the GPU is out of memory.
Unfortunately, I think something else is at play here. This laptop is blessed with nVidia's Advanced Optimus, and for the most part the nVidia GPU is switched off.
I have a hunch that this may be what is triggering this error.
If you have any ideas on how to get this to work, I am all ears.
Also, of such a helpful log option existed for the motion tracking I could definitely figure out why it's working so poorly on my system.