CarlGao4 / Demucs-Gui

A GUI for music separation AI demucs
GNU General Public License v3.0
499 stars 37 forks source link

Bug: 1.2b1 CUDA fails to separate #62

Closed shotfirer closed 3 months ago

shotfirer commented 3 months ago

happen

Build 1.2b1_cuda_mkl fails to separate the file. Previous build 1.2a1_cuda separates the same file without a hitch.

What is the platform you are using?

Windows

log

2024-05-12 14:51:01,442 (GuiMain.py) (Line 2040) [INFO] : Python version: 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:27:10) [MSC v.1938 64 bit (AMD64)]
2024-05-12 14:51:01,442 (GuiMain.py) (Line 2041) [INFO] : Demucs GUI version: 1.2b1
2024-05-12 14:51:01,471 (GuiMain.py) (Line 2042) [INFO] : System: Windows-10-10.0.19045-SP0
2024-05-12 14:51:01,472 (GuiMain.py) (Line 2043) [INFO] : Architecture: 64bit
2024-05-12 14:51:01,472 (GuiMain.py) (Line 2044) [INFO] : CPU: Intel64 Family 6 Model 151 Stepping 2, GenuineIntel
2024-05-12 14:51:01,472 (GuiMain.py) (Line 2045) [INFO] : CPU count: 20
2024-05-12 14:51:01,477 (GuiMain.py) (Line 2046) [INFO] : System memory: 34212798464 (31.863GB)
2024-05-12 14:51:01,481 (GuiMain.py) (Line 2049) [INFO] : System free memory: 19877367808 (18.512GB)
2024-05-12 14:51:01,558 (GuiMain.py) (Line 2053) [INFO] : System swap memory: 8589934592 (8GB)
2024-05-12 14:51:01,610 (find_device_win.py) (Line 207) [INFO] : Found GPU: NVIDIA GeForce RTX 3060 (10DE:2487)
2024-05-12 14:51:01,610 (GuiMain.py) (Line 2071) [INFO] : Using PySide6
2024-05-12 14:51:01,610 (GuiMain.py) (Line 2072) [INFO] : Qt version: 6.7.0
2024-05-12 14:51:01,610 (GuiMain.py) (Line 2073) [INFO] : PySide6 version: 6.7.0
2024-05-12 14:51:01,656 (shared.py) (Line 356) [INFO] : [1] Thread starter (separator.py) starts
2024-05-12 14:51:01,719 (GuiMain.py) (Line 2078) [DEBUG] : Supported styles: windows11, windowsvista, Windows, Fusion
2024-05-12 14:51:01,721 (GuiMain.py) (Line 2082) [DEBUG] : Current style: windowsvista
intel_extension_for_pytorch\xpu\lazy_init.py:80: UserWarning: XPU Device count is zero! (Triggered internally at E:/AI/ipex-build/2.1.30/intel-extension-for-pytorch/csrc/gpu/runtime/Device.cpp:127.)
  _C._initExtension()
2024-05-12 14:51:09,151 (separator.py) (Line 64) [INFO] : Intel Extension for PyTorch version: 2.1.30+xpu
2024-05-12 14:51:09,151 (separator.py) (Line 64) [INFO] : Intel Extension for PyTorch version: 2.1.30+xpu
2024-05-12 14:51:09,151 (separator.py) (Line 64) [INFO] : Intel Extension for PyTorch version: 2.1.30+xpu
2024-05-12 14:51:09,152 (separator.py) (Line 64) [INFO] : Intel Extension for PyTorch version: 2.1.30+xpu
2024-05-12 14:51:09,152 (separator.py) (Line 64) [INFO] : Intel Extension for PyTorch version: 2.1.30+xpu
2024-05-12 14:51:09,157 (utils.py) (Line 93) [DEBUG] : Attempting to load FFmpeg version 6.
2024-05-12 14:51:09,159 (utils.py) (Line 130) [DEBUG] : Failed to load FFmpeg 6 extension.
Traceback (most recent call last):
  File "PyInstaller\loader\pyimod03_ctypes.py", line 53, in __init__
  File "ctypes\__init__.py", line 376, in __init__
FileNotFoundError: Could not find module 'F:\Demucs-GUI_1.2b1_cuda_mkl\torchaudio\lib\libtorchaudio_ffmpeg6.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "torchaudio\_extension\utils.py", line 128, in _find_ffmpeg_extension
    return _find_versionsed_ffmpeg_extension(ffmpeg_ver)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torchaudio\_extension\utils.py", line 115, in _find_versionsed_ffmpeg_extension
    _load_lib(library)
  File "torchaudio\_extension\utils.py", line 64, in _load_lib
    torch.ops.load_library(path)
  File "torch\_ops.py", line 852, in load_library
    ctypes.CDLL(path)
  File "PyInstaller\loader\pyimod03_ctypes.py", line 55, in __init__
pyimod03_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'F:\\Demucs-GUI_1.2b1_cuda_mkl\\torchaudio\\lib\\libtorchaudio_ffmpeg6.pyd'. Most likely this dynlib/dll was not found when the application was frozen.
2024-05-12 14:51:09,160 (utils.py) (Line 93) [DEBUG] : Attempting to load FFmpeg version 5.
2024-05-12 14:51:09,355 (utils.py) (Line 130) [DEBUG] : Failed to load FFmpeg 5 extension.
Traceback (most recent call last):
  File "torchaudio\_extension\utils.py", line 128, in _find_ffmpeg_extension
    return _find_versionsed_ffmpeg_extension(ffmpeg_ver)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torchaudio\_extension\utils.py", line 113, in _find_versionsed_ffmpeg_extension
    _try_access_avutil(ffmpeg_ver)
  File "torchaudio\_extension\utils.py", line 89, in _try_access_avutil
    torchaudio.lib._torchaudio.find_avutil(libavutil)
RuntimeError: error in LoadLibrary for avutil-57.dll. WinError 126: The specified module could not be found.

2024-05-12 14:51:09,355 (utils.py) (Line 93) [DEBUG] : Attempting to load FFmpeg version 4.
2024-05-12 14:51:09,356 (utils.py) (Line 130) [DEBUG] : Failed to load FFmpeg 4 extension.
Traceback (most recent call last):
  File "torchaudio\_extension\utils.py", line 128, in _find_ffmpeg_extension
    return _find_versionsed_ffmpeg_extension(ffmpeg_ver)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torchaudio\_extension\utils.py", line 113, in _find_versionsed_ffmpeg_extension
    _try_access_avutil(ffmpeg_ver)
  File "torchaudio\_extension\utils.py", line 89, in _try_access_avutil
    torchaudio.lib._torchaudio.find_avutil(libavutil)
RuntimeError: error in LoadLibrary for avutil-56.dll. WinError 126: The specified module could not be found.

2024-05-12 14:51:09,356 (__init__.py) (Line 96) [DEBUG] : Failed to initialize ffmpeg bindings
Traceback (most recent call last):
  File "torchaudio\_extension\__init__.py", line 89, in <module>
    _FFMPEG_EXT = _init_ffmpeg()
                  ^^^^^^^^^^^^^^
  File "torchaudio\_extension\utils.py", line 162, in _init_ffmpeg
    ext = _find_ffmpeg_extension(ffmpeg_vers, show_error)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torchaudio\_extension\utils.py", line 132, in _find_ffmpeg_extension
    raise ImportError(f"Failed to intialize FFmpeg extension. Tried versions: {ffmpeg_vers}")
ImportError: Failed to intialize FFmpeg extension. Tried versions: ['6', '5', '4']
PyInstaller\loader\pyimod02_importers.py:419: UserWarning: TorchAudio's global backend is now deprecated. Please enable distpatcher by setting `TORCHAUDIO_USE_BACKEND_DISPATCHER=1`, and specify backend when calling load/info/save function.
2024-05-12 14:51:09,499 (audio.py) (Line 34) [INFO] : Soundfile version: 0.12.1
2024-05-12 14:51:09,500 (audio.py) (Line 35) [INFO] : libsndfile version: 1.2.0
2024-05-12 14:51:09,500 (audio.py) (Line 36) [INFO] : SoXR version: 0.3.7
2024-05-12 14:51:09,500 (audio.py) (Line 37) [INFO] : libsoxr version: 0.1.3-7-gacc0dac
2024-05-12 14:51:09,501 (separator.py) (Line 88) [INFO] : Demucs version: 4.1.0a2
2024-05-12 14:51:09,501 (separator.py) (Line 89) [INFO] : PyTorch version: 2.1.0+cu118
torch\cuda\__init__.py:190: UserWarning: 
    Found GPU0 NVIDIA GeForce RTX 3060 which is of cuda capability 8.6.
    PyTorch no longer supports this GPU because it is too old.
    The minimum cuda capability supported by this library is 8.9.

  warnings.warn(
2024-05-12 14:51:09,502 (separator.py) (Line 99) [INFO] : CUDA Info: _CudaDeviceProperties(name='NVIDIA GeForce RTX 3060', major=8, minor=6, total_memory=12287MB, multi_processor_count=28)
2024-05-12 14:51:10,562 (audio.py) (Line 49) [INFO] : ffmpeg -version output:
ffmpeg version 6.1.1-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers

built with gcc 12.2.0 (Rev10, Built by MSYS2 project)

configuration: --enable-gpl --enable-version3 --enable-shared --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint

libavutil      58. 29.100 / 58. 29.100

libavcodec     60. 31.102 / 60. 31.102

libavformat    60. 16.100 / 60. 16.100

libavdevice    60.  3.100 / 60.  3.100

libavfilter     9. 12.100 /  9. 12.100

libswscale      7.  5.100 /  7.  5.100

libswresample   4. 12.100 /  4. 12.100

libpostproc    57.  3.100 / 57.  3.100

2024-05-12 14:51:10,610 (audio.py) (Line 54) [INFO] : Using ffmpeg from F:\Demucs-GUI_1.2b1_cuda_mkl\ffmpeg\ffmpeg.EXE
2024-05-12 14:51:10,610 (audio.py) (Line 55) [INFO] : ffprobe -version output:
ffprobe version 6.1.1-full_build-www.gyan.dev Copyright (c) 2007-2023 the FFmpeg developers

built with gcc 12.2.0 (Rev10, Built by MSYS2 project)

configuration: --enable-gpl --enable-version3 --enable-shared --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint

libavutil      58. 29.100 / 58. 29.100

libavcodec     60. 31.102 / 60. 31.102

libavformat    60. 16.100 / 60. 16.100

libavdevice    60.  3.100 / 60.  3.100

libavfilter     9. 12.100 /  9. 12.100

libswscale      7.  5.100 /  7.  5.100

libswresample   4. 12.100 /  4. 12.100

libpostproc    57.  3.100 / 57.  3.100

2024-05-12 14:51:11,611 (shared.py) (Line 367) [INFO] : [1] Thread starter (separator.py) ends
2024-05-12 14:51:11,618 (shared.py) (Line 356) [INFO] : [2] Thread checkUpdate (shared.py) starts
2024-05-12 14:51:11,626 (shared.py) (Line 383) [INFO] : Checking for updates...
2024-05-12 14:51:12,400 (shared.py) (Line 386) [INFO] : Latest version: 1.2b1
2024-05-12 14:51:12,401 (shared.py) (Line 367) [INFO] : [2] Thread checkUpdate (shared.py) ends
2024-05-12 14:51:36,790 (shared.py) (Line 356) [INFO] : [3] Thread loadModel (GuiMain.py) starts
2024-05-12 14:51:36,792 (GuiMain.py) (Line 647) [INFO] : Loading model htdemucs from repo F:\Demucs-GUI_1.2b1_cuda_mkl\pretrained
2024-05-12 14:51:37,081 (GuiMain.py) (Line 675) [INFO] : Model loaded within 0.2865s
2024-05-12 14:51:37,081 (GuiMain.py) (Line 676) [INFO] : Model: htdemucs
Repo: F:\Demucs-GUI_1.2b1_cuda_mkl\pretrained
Type: Bag of models
Audio channels: 2
Sample rate: 44100
Sources: drums, bass, other, vocals

Model 0:
 Type: HTDemucs
 Default segment: 7.8
 Weight: [1.0, 1.0, 1.0, 1.0]
2024-05-12 14:51:37,091 (shared.py) (Line 367) [INFO] : [3] Thread loadModel (GuiMain.py) ends
2024-05-12 14:51:37,091 (shared.py) (Line 270) [DEBUG] : (switchEncoder) Set history ('encoder',) to 0
2024-05-12 14:51:37,091 (shared.py) (Line 272) [DEBUG] : History not changed, ignored
2024-05-12 14:51:37,092 (GuiMain.py) (Line 1502) [INFO] : Preset stem key: ["bass","drums","other","vocals"]
2024-05-12 14:51:37,092 (GuiMain.py) (Line 1657) [INFO] : Adding saved presets: []
2024-05-12 14:51:46,160 (shared.py) (Line 356) [INFO] : [4] Thread separate (separator.py) starts
2024-05-12 14:51:46,160 (separator.py) (Line 459) [INFO] : Start separating audio: 14 Gethsemane.mp3
2024-05-12 14:51:46,161 (separator.py) (Line 460) [INFO] : Parameters: segment=7.80 overlap=0.25 shifts=0
2024-05-12 14:51:46,161 (separator.py) (Line 461) [INFO] : Device: cuda:0
2024-05-12 14:51:46,161 (audio.py) (Line 66) [DEBUG] : Reading audio with soundfile: D:\14 Gethsemane.mp3
2024-05-12 14:51:46,457 (audio.py) (Line 82) [INFO] : Read audio D:\14 Gethsemane.mp3: samplerate=44100 shape=(14673024, 2)
2024-05-12 14:51:46,562 (separator.py) (Line 497) [INFO] : Running separation...
2024-05-12 14:51:46,810 (separator.py) (Line 518) [ERROR] : Traceback (most recent call last):
  File "separator.py", line 512, in separate
  File "demucs\api.py", line 271, in separate_tensor
  File "demucs\apply.py", line 216, in apply_model
  File "demucs\apply.py", line 271, in apply_model
RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

2024-05-12 14:51:46,876 (shared.py) (Line 367) [INFO] : [4] Thread separate (separator.py) ends
CarlGao4 commented 3 months ago

I changed the library version in 1.2b1, which only supports RTX 40 Series or newer I'll upload another build later

CarlGao4 commented 3 months ago

Please try the latest 1.2b2

shotfirer commented 3 months ago

1.2b2 works like a charm, thank you!