Const-me / Whisper

High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model
Mozilla Public License 2.0
8.48k stars 728 forks source link

Works with WINE on Linux/Mac thanks to using DirectX 11 instead of 12 #42

Open philipag opened 1 year ago

philipag commented 1 year ago

For anyone interested: I have tested this library running an app under WINE 8.3 (www.winehq.org) on Linux and it works thanks to NOT requiring DirectX12 (WINE only goes up to 11 at this time). Unless there are performance improvements it might be good to keep targeting the DirectX 11 API for the time being.

The only issue was the use of CreateDecompressor in shaders.cpp because the WINE's cabinet.dll does not support those functions. I had to disable this compression/decompression pair to make things work. Not sure this size matters so much so perhaps it's better to just leave out compression?

Const-me commented 1 year ago

That’s great news!

Yeah, staying on D3D11 is probably a good idea. Not only due to Linux, but the newer GPU API is substantially harder to use.

To address the compatibility issue about the missing compression algorithm, I’ve published another version 1.9. That version no longer uses the compression implemented by the cabinet.dll OS component. Instead, the DLL now includes LZ4 decompressor, version 1.9.4. Please test when you have time.

P.S. By the way, LZ4 is rather simple algorithm. The DLL size has only increased by 4kb as a result of this change, basically nothing. Removing the compression entirely would increase the size by more than 100kb, which exceeds 20%.

philipag commented 1 year ago

Great thanks. I will test this more thoroughly on Linux and Mac in the following weeks...

emcodem commented 1 year ago

@Const-me for me the lz4 stuff made loading the model fail (windows). To make it work again, I needed to revert to the commit before "[Switched shader compression algorithm from MSZIP to LZ4-HC)"

Does it mean that we have to use different ggml model files from now on?

philipag commented 1 year ago

@emcodem You probably just have to re-run "CompressShaders" for things to work again.

emcodem commented 1 year ago

@philipag that did the trick, damn i thought about it but didnt actually do it :-(

adamreed90 commented 1 year ago

Have you tried this with Proton? Also in regards to D12, it seems they are looking to fully support D12 (https://github.com/HansKristian-Work/vkd3d-proton)

faveoled commented 1 year ago

Doesn't work for me in #177

nms42 commented 1 year ago

Doesn't work for me in #177

Without WINE details (version, config, logs, ...) only telepatic ones can help

faveoled commented 1 year ago

@nms42 I've updated my issue

philipag commented 1 year ago

@faveoled If you install WINE 8.3 do things work as expected? There have been a few Vulcan-related changes in recent betas that could have an impact on Whisper.

faveoled commented 1 year ago

@philipag Tried 8.3 with Bottles, same error (last wine was installed natively)

philipag commented 1 year ago

@faveoled In my case I am running a custom application which uses Whisper. I had to install additional dependencies in WINE like the proper .Net runtime. Perhaps your problem lies along those lines. I don't know how familiar you are with WINE but it can be a bit of work to find out exactly where a problem lies.