axeldelafosse / stemgen

🎛 Stemgen is a Stem file generator. Convert any track into a Stem and have fun with Traktor.
https://stemgen.dev
MIT License
212 stars 39 forks source link

Intel GPU accelleration #54

Open MemeGLS opened 1 month ago

MemeGLS commented 1 month ago

Hello, I'm looking for a way to use the GPU acceleration with an Intel GPU. I was able to use it with demucs-gui https://github.com/CarlGao4/Demucs-Gui/releases, but unfortunately I wasn't able to do it via Stemgen.

I'm currently on Windows 11 with an Intel Arc Graphic and this is what happen when I run the command:

C:\Users\emiso\stemgen>python stemgen.py "C:\Users\emiso\stemgen\sources\Kavinsky - Nightcall.flac" -d cuda Using GPU for processing. Output dir already exists. Working dir created. Done. Extracting bit depth... bits_per_sample=16 Done. Extracting sample rate... sample_rate=44100 Done. Extracting cover... ffmpeg version N-117094-g2bf588f273-20240921 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14.2.0 (crosstool-NG 1.26.0.106_ed12fa6) 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 --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-libxml2 --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --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-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libvvenc --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=20240921 libavutil 59. 37.100 / 59. 37.100 libavcodec 61. 17.100 / 61. 17.100 libavformat 61. 6.100 / 61. 6.100 libavdevice 61. 2.101 / 61. 2.101 libavfilter 10. 3.100 / 10. 3.100 libswscale 8. 2.100 / 8. 2.100 libswresample 5. 2.100 / 5. 2.100 libpostproc 58. 2.100 / 58. 2.100 Input #0, flac, from 'C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/Kavinsky - Nightcall.flac': Metadata: TITLE : Nightcall ARTIST : Kavinsky ALBUM : Nightcall track : 1 disc : 1 DATE : 2012-10-22 LENGTH : 257000 BPM : 91.1 PUBLISHER : Digital Distribution Serbia ISRC : FRS710900410 LYRICS : I'm giving you a night call to tell you how I feel : I want to drive you through the night, down the hills : I'm gonna tell you something you don't want to hear : I'm gonna show you where it's dark, but have no fear : : There something inside you : It's hard to explain : They're talking about you boy : But you're still the same : : There something inside you : It's hard to explain : They're talking about you boy : But you're still the same : : I'm giving you a night call to tell you how I feel : I want to drive you through the night, down the hills : I'm gonna tell you something you don't want to hear : I'm gonna show you where it's dark, but have no fear : : There something inside you : It's hard to explain : They're talking about you boy : But you're still the same : : There something inside you : It's hard to explain : They're talking about you boy : But you're still the same : : There something inside you (there's something inside you) : It's hard to explain (it's hard to explain ) : They're talking about you boy (they're talking about you boy) : But you're still the same Duration: 00:04:17.32, start: 0.000000, bitrate: 1015 kb/s Stream #0:0: Audio: flac, 44100 Hz, stereo, s16 Stream #0:1: Video: mjpeg (Progressive), yuvj444p(pc, bt470bg/unknown/unknown), 800x800 [SAR 300:300 DAR 1:1], 90k tbr, 90k tbn (attached pic) Metadata: comment : Cover (front) Stream mapping: Stream #0:1 -> #0:0 (copy) Output #0, image2, to 'C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/cover.jpg': Metadata: TITLE : Nightcall ARTIST : Kavinsky ALBUM : Nightcall track : 1 disc : 1 DATE : 2012-10-22 LENGTH : 257000 BPM : 91.1 PUBLISHER : Digital Distribution Serbia ISRC : FRS710900410 LYRICS : I'm giving you a night call to tell you how I feel : I want to drive you through the night, down the hills : I'm gonna tell you something you don't want to hear : I'm gonna show you where it's dark, but have no fear : : There something inside you : It's hard to explain : They're talking about you boy : But you're still the same : : There something inside you : It's hard to explain : They're talking about you boy : But you're still the same : : I'm giving you a night call to tell you how I feel : I want to drive you through the night, down the hills : I'm gonna tell you something you don't want to hear : I'm gonna show you where it's dark, but have no fear : : There something inside you : It's hard to explain : They're talking about you boy : But you're still the same : : There something inside you : It's hard to explain : They're talking about you boy : But you're still the same : : There something inside you (there's something inside you) : It's hard to explain (it's hard to explain ) : They're talking about you boy (they're talking about you boy) : But you're still the same encoder : Lavf61.6.100 Stream #0:0: Video: mjpeg (Progressive), yuvj444p(pc, bt470bg/unknown/unknown), 800x800 [SAR 300:300 DAR 1:1], q=2-31, 90k tbr, 90k tbn (attached pic) Metadata: comment : Cover (front) Press [q] to stop, [?] for help [image2 @ 000002195b8ba880] The specified filename 'C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/cover.jpg' does not contain an image sequence pattern or a pattern is invalid. [image2 @ 000002195b8ba880] Use a pattern such as %03d for an image sequence or use the -update option (with -frames:v 1 if needed) to write a single image. [out#0/image2 @ 000002195b85e640] video:74KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 1 fps=0.0 q=-1.0 Lsize=N/A time=N/A bitrate=N/A speed=N/A Cover extracted with ffmpeg. Done. Extracting metadata... TITLE=Nightcall ARTIST=Kavinsky ALBUM=Nightcall TRACKNUMBER=1 DISCNUMBER=1 DATE=2012-10-22 LENGTH=257000 BPM=91.1 PUBLISHER=Digital Distribution Serbia ISRC=FRS710900410 BARCODE= LYRICS=I'm giving you a night call to tell you how I feel I want to drive you through the night, down the hills I'm gonna tell you something you don't want to hear I'm gonna show you where it's dark, but have no fear

There something inside you It's hard to explain They're talking about you boy But you're still the same

There something inside you It's hard to explain They're talking about you boy But you're still the same

I'm giving you a night call to tell you how I feel I want to drive you through the night, down the hills I'm gonna tell you something you don't want to hear I'm gonna show you where it's dark, but have no fear

There something inside you It's hard to explain They're talking about you boy But you're still the same

There something inside you It's hard to explain They're talking about you boy But you're still the same

There something inside you (there's something inside you) It's hard to explain (it's hard to explain ) They're talking about you boy (they're talking about you boy) But you're still the same {'title': 'Nightcall', 'artist': 'Kavinsky', 'album': 'Nightcall', 'year': '2012-10-22', 'track_no': '1', 'bpm': '91.1', 'lyrics': "I'm giving you a night call to tell you how I feel\r\nI want to drive you through the night, down the hills\r\nI'm gonna tell you something you don't want to hear\r\nI'm gonna show you where it's dark, but have no fear\r\n\r\nThere something inside you\r\nIt's hard to explain\r\nThey're talking about you boy\r\nBut you're still the same\r\n\r\nThere something inside you\r\nIt's hard to explain\r\nThey're talking about you boy\r\nBut you're still the same\r\n\r\nI'm giving you a night call to tell you how I feel\r\nI want to drive you through the night, down the hills\r\nI'm gonna tell you something you don't want to hear\r\nI'm gonna show you where it's dark, but have no fear\r\n\r\nThere something inside you\r\nIt's hard to explain\r\nThey're talking about you boy\r\nBut you're still the same\r\n\r\nThere something inside you\r\nIt's hard to explain\r\nThey're talking about you boy\r\nBut you're still the same\r\n\r\nThere something inside you (there's something inside you)\r\nIt's hard to explain (it's hard to explain )\r\nThey're talking about you boy (they're talking about you boy)\r\nBut you're still the same", 'barcode': '', 'isrc': 'FRS710900410', 'cover': 'C:\Users\emiso\stemgen\output\Kavinsky - Nightcall\cover.jpg'} Creating tags.json... Done. Converting to wav and/or downsampling...

Input File : 'C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/Kavinsky - Nightcall.flac' Channels : 2 Sample Rate : 44100 Precision : 16-bit Duration : 00:04:17.32 = 11347812 samples = 19299 CDDA sectors File Size : 32.7M Bit Rate : 1.02M Sample Encoding: 16-bit FLAC Comments : TITLE=Nightcall ARTIST=Kavinsky ALBUM=Nightcall TRACKNUMBER=1 DISCNUMBER=1 DATE=2012-10-22 LENGTH=257000 BPM=91.1 PUBLISHER=Digital Distribution Serbia ISRC=FRS710900410 BARCODE= LYRICS=I'm giving you a night call to tell you how I feel I want to drive you through the night, down the hills I'm gonna tell you something you don't want to hear I'm gonna show you where it's dark, but have no fear

There something inside you It's hard to explain They're talking about you boy But you're still the same

There something inside you It's hard to explain They're talking about you boy But you're still the same

I'm giving you a night call to tell you how I feel I want to drive you through the night, down the hills I'm gonna tell you something you don't want to hear I'm gonna show you where it's dark, but have no fear

There something inside you It's hard to explain They're talking about you boy But you're still the same

There something inside you It's hard to explain They're talking about you boy But you're still the same

There something inside you (there's something inside you) It's hard to explain (it's hard to explain ) They're talking about you boy (they're talking about you boy) But you're still the same

In:100% 00:04:17.32 [00:00:00.00] Out:11.3M [!=====|=====!] Hd:0.0 Clip:0 Done. Done. Ready! Creating a Stem file for Kavinsky - Nightcall... Splitting stems... Using 16-bit model... Selected model is a bag of 1 models. You will see that many progress bars per track. Separated tracks will be stored in C:\Users\emiso\stemgen\output\Kavinsky - Nightcall\htdemucs Separating track C:\Users\emiso\stemgen\output\Kavinsky - Nightcall\Kavinsky - Nightcall.flac Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\emiso\AppData\Local\Programs\Python\Python312\Lib\site-packages\demucs__main.py", line 10, in main() File "C:\Users\emiso\AppData\Local\Programs\Python\Python312\Lib\site-packages\demucs\separate.py", line 173, in main sources = apply_model(model, wav[None], device=args.device, shifts=args.shifts, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\emiso\AppData\Local\Programs\Python\Python312\Lib\site-packages\demucs\apply.py", line 187, in apply_model sub_model.to(device) File "C:\Users\emiso\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 1174, in to return self._apply(convert) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\emiso\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 780, in _apply module._apply(fn) File "C:\Users\emiso\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 780, in _apply module._apply(fn) File "C:\Users\emiso\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 780, in _apply module._apply(fn) File "C:\Users\emiso\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 805, in _apply param_applied = fn(param) ^^^^^^^^^ File "C:\Users\emiso\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 1160, in convert return t.to( ^^^^^ File "C:\Users\emiso\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\cuda\init__.py", line 314, in _lazy_init torch._C._cuda_init() RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx Done. Creating stem...

[Done 0/6]

converting C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/Kavinsky - Nightcall.wav to alac... ffmpeg version N-117094-g2bf588f273-20240921 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14.2.0 (crosstool-NG 1.26.0.106_ed12fa6) 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 --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-libxml2 --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --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-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libvvenc --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=20240921 libavutil 59. 37.100 / 59. 37.100 libavcodec 61. 17.100 / 61. 17.100 libavformat 61. 6.100 / 61. 6.100 libavdevice 61. 2.101 / 61. 2.101 libavfilter 10. 3.100 / 10. 3.100 libswscale 8. 2.100 / 8. 2.100 libswresample 5. 2.100 / 5. 2.100 libpostproc 58. 2.100 / 58. 2.100 [aist#0:0/pcm_s16le @ 0000027f90812fc0] Guessed Channel Layout: stereo Input #0, wav, from 'C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/Kavinsky - Nightcall.wav': Duration: 00:04:17.32, bitrate: 1411 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s Stream mapping: Stream #0:0 -> #0:0 (pcm_s16le (native) -> alac (native)) Press [q] to stop, [?] for help Output #0, ipod, to 'C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/Kavinsky - Nightcall.m4a': Metadata: encoder : Lavf61.6.100 Stream #0:0: Audio: alac (alac / 0x63616C61), 44100 Hz, stereo, s16p, 128 kb/s Metadata: encoder : Lavc61.17.100 alac [out#0/ipod @ 0000027f9085e000] video:0KiB audio:32445KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.036847% size= 32457KiB time=00:04:17.32 bitrate=1033.3kbits/s speed= 414x

[Done 1/6]

converting C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/htdemucs/Kavinsky - Nightcall/drums.wav to alac... ffmpeg version N-117094-g2bf588f273-20240921 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14.2.0 (crosstool-NG 1.26.0.106_ed12fa6) 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 --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-libxml2 --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --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-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libvvenc --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=20240921 libavutil 59. 37.100 / 59. 37.100 libavcodec 61. 17.100 / 61. 17.100 libavformat 61. 6.100 / 61. 6.100 libavdevice 61. 2.101 / 61. 2.101 libavfilter 10. 3.100 / 10. 3.100 libswscale 8. 2.100 / 8. 2.100 libswresample 5. 2.100 / 5. 2.100 libpostproc 58. 2.100 / 58. 2.100 [in#0 @ 0000021e0fb4dac0] Error opening input: No such file or directory Error opening input file C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/htdemucs/Kavinsky - Nightcall/drums.wav. Error opening input files: No such file or directory Command '['ffmpeg', '-i', 'C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/htdemucs/Kavinsky - Nightcall/drums.wav', '-c:a', 'alac', '-c:v', 'copy', 'C:\Users\emiso\stemgen\output/Kavinsky - Nightcall/htdemucs/Kavinsky - Nightcall/drums.m4a']' returned non-zero exit status 4294967294. Done. Cleaning... Done. Success! Have fun :)