rakuri255 / UltraSinger

AI based tool to convert vocals lyrics and pitch from music to autogenerate Ultrastar Deluxe, Midi and notes. It automatic tapping, adding text, pitch vocals and creates karaoke files.
MIT License
230 stars 19 forks source link

Error: "cublas64_12.dll is not found or cannot be loaded" #140

Open BanCrash opened 2 months ago

BanCrash commented 2 months ago

Hi, I just bought a portable computer with a NVidia 4060, I installed all the requirements but when trying to use I get the error of the title:

Traceback (most recent call last):
  File "C:\Programas\UltraSinger\src\UltraSinger.py", line 985, in <module>
    main(sys.argv[1:])
  File "C:\Programas\UltraSinger\src\UltraSinger.py", line 884, in main
    run()
  File "C:\Programas\UltraSinger\src\UltraSinger.py", line 392, in run
    detected_language, transcribed_data = transcribe_audio()
  File "C:\Programas\UltraSinger\src\UltraSinger.py", line 515, in transcribe_audio
    transcribed_data, detected_language = transcribe_with_whisper(
  File "C:\Programas\UltraSinger\src\modules\Speech_Recognition\Whisper.py", line 61, in transcribe_with_whisper
    result = loaded_whisper_model.transcribe(
  File "C:\Programas\UltraSinger\.venv\lib\site-packages\whisperx\asr.py", line 194, in transcribe
    language = language or self.detect_language(audio)
  File "C:\Programas\UltraSinger\.venv\lib\site-packages\whisperx\asr.py", line 252, in detect_language
    encoder_output = self.model.encode(segment)
  File "C:\Programas\UltraSinger\.venv\lib\site-packages\whisperx\asr.py", line 86, in encode
    return self.model.encode(features, to_cpu=to_cpu)
RuntimeError: Library cublas64_12.dll is not found or cannot be loaded

Is there anything I can do for fixing this or is a compatibility issue?

rakuri255 commented 2 months ago

We have an ongoing discussion about it at #130 You can fix it by installing another pytourch version.

BanCrash commented 2 months ago

We have an ongoing discussion about it at #130 You can fix it by installing another pytourch version.

Oops, I didn't check it, sorry!

That solves the issue and compiles, though Crepe uses CPU:

[UltraSinger] Pitching with crepe and model full and cpu as worker

Because of this:

[UltraSinger] Checking GPU support for tensorflow and pytorch.
2024-05-05 19:37:23.586528: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2024-05-05 19:37:23.587145: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublas64_11.dll'; dlerror: cublas64_11.dll not found
2024-05-05 19:37:23.587498: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublasLt64_11.dll'; dlerror: cublasLt64_11.dll not found
2024-05-05 19:37:23.588825: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2024-05-05 19:37:23.593642: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusparse64_11.dll'; dlerror: cusparse64_11.dll not found
2024-05-05 19:37:23.593798: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1850] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
[UltraSinger] tensorflow - there are no cuda devices available -> Using cpu.
[UltraSinger] tensorflow - versions above 2.10 dropped GPU support for Windows, refer to the readme for possible solutions.
[UltraSinger] pytorch - using cuda gpu.

BTW, I wouldn't mind to try the WSL solution, but I don't know how to follow after running the command:

sudo apt update && sudo apt install nvidia-cuda-toolkit

Because following the tutorial makes this issue:

/mnt/c/Programas/UltraSinger-WSL$ .venv\Scripts\activate
.venvScriptsactivate: command not found
/mnt/c/Programas/UltraSinger-WSL$ cd .venv
/mnt/c/Programas/UltraSinger-WSL/.venv$ ls -a
.  ..  bin  include  lib  lib64  pyvenv.cfg
/mnt/c/Programas/UltraSinger-WSL/.venv$ cd Scripts
-bash: cd: Scripts: No such file or directory

I imagine that the instructions for using python on linux would be different, but I never used so I don't know how to proceed.

rakuri255 commented 2 months ago

What command did you use? Have you also add the +cuXXX after each package? Like here: pip3 install torch==2.0.1+cu117 torchvision==0.15.2+cu117 torchaudio==2.0.2+cu117 --index-url https://download.pytorch.org/whl/cu117

rakuri255 commented 2 months ago

@BanCrash i created an issue for WSL :)

BanCrash commented 1 month ago

Have you also add the +cuXXX after each package? Like here: pip3 install torch==2.0.1+cu117 torchvision==0.15.2+cu117 torchaudio==2.0.2+cu117 --index-url https://download.pytorch.org/whl/cu117

Nothing special, just UltraSinger.py -i -o .

Have you also add the +cuXXX after each package? Like here: pip3 install torch==2.0.1+cu117 torchvision==0.15.2+cu117 torchaudio==2.0.2+cu117 --index-url https://download.pytorch.org/whl/cu117

Yes, I used this command: pip install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/cu121 ,as stated on the other issue.

EDIT: I see now that I didn't, I'll do it now.

BanCrash commented 1 month ago

I went with pip install torch==2.2.1+cu121 torchvision==0.17.1+cu121 torchaudio==2.2.1+cu121 --index-url https://download.pytorch.org/whl/cu121, but the issue still exists...

rakuri255 commented 1 month ago

try cu118

BanCrash commented 1 month ago

I went with pip install torch==2.2.1+cu118 torchvision==0.17.1+cu118 torchaudio==2.2.1+cu118 --index-url https://download.pytorch.org/whl/cu118

Same initial error: RuntimeError: Library cublas64_12.dll is not found or cannot be loaded

Aydonger commented 3 weeks ago

Im absolutly aware that this is not a "Solution" - but i encountered the same Problem.

And solved it in this way: "Path to UltraSinger\.venv\Lib\site-packages\torch\lib\"

I needed the following DLL-Files (found all of them on dllme.com):

_cublasLt64_10.dll cublasLt64_11.dll cufft64_10.dll cusparse6411.dll

All of them are copied in the Torch-lib Path. AND i take the following File from my installed nVidia CUDA Directory (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin)

_cusparse6412.dll

I also renamed the "_cusparse6412.dll" to "_cusparse6411.dll" (cause the _11.dll File from dllme.com doesnt work on my PC) and copied it also into the Torch-Lib Path.

And after all these "new" DLL-FIles in the lib-Directory, it runs with GPU CUDA-Support. Im aware, that this is not a waterproof solution, but it works for me.

rakuri255 commented 3 weeks ago

@Aydonger have you tried to install the Cuda Toolkit? @BanCrash you also tried this?

BanCrash commented 3 weeks ago

@Aydonger have you tried to install the Cuda Toolkit? @BanCrash you also tried this?

I just tested installed that and last version, and using whisper large-v3 is working as expected, except for hyphenation (maybe for using large-v3 instead large-v2?

[UltraSinger] Error in hyphenation for language en, maybe you want to disable it?

rakuri255 commented 3 weeks ago

ok [UltraSinger] Error in hyphenation for language en, maybe you want to disable it? is some other issue. But did this fix the .dll issue?

BanCrash commented 2 weeks ago

ok [UltraSinger] Error in hyphenation for language en, maybe you want to disable it? is some other issue. But did this fix the .dll issue?

Yes, as I've said, now it's working as expected.

Aydonger commented 2 weeks ago

@Aydonger have you tried to install the Cuda Toolkit? @BanCrash you also tried this?

As i sayed in my previous Post:

AND i take the following File from my installed nVidia CUDA Directory (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin)

yes, the CUDA Toolkit from nVidia is installed. From this directory (as mentioned before) i took the _cusparse6412.dll and use this in the torch/lib Directory.

Again, it seems (in my case), that Tensorflow dont regonize the CUDA Installation on C:... - but when i took all the ddl-Files in the "lib"-Folder on the torch Application, it runs perfect. Maybe a Problem with the path or something...?