Skip to content

How-ToGPU

How to Split a Song Into Stems With Demucs on Windows, Linux or Mac

How to run Demucs 4.1 with uv on Windows, Linux or Mac, split songs into drums, bass, vocals and other stems, use an NVIDIA GPU and get round out-of-memory errors.

By , Systems & Technical Editor

5 min read

How to Split a Song Into Stems With Demucs on Windows, Linux or Mac

The commands and figures come from the Demucs GitHub README, its Windows, Linux and macOS support pages, its release notes and the Python Package Index (PyPI), all read on 3 December 2026. Quality scores quoted below are the researchers' own.

Demucs is a free, MIT-licensed music source separation model originally developed at Meta by Alexandre Défossez, who now maintains it in his own GitHub repository after leaving to join Kyutai. It splits any song into four stems (drums, bass, vocals and other) and can also do a simple two-way vocals and accompaniment split for karaoke. It's the same engine behind the Demucs option in Ultimate Vocal Remover, but used directly from a terminal, which makes it ideal for batch jobs and scripts.

The current version is Demucs 4.1.0, released on 11 July 2026. It modernised the packaging, cut the inference dependencies (torchaudio is no longer needed to separate tracks) and moved the pretrained models to Hugging Face. Be aware that the maintainer says he's "not actively working on Demucs anymore", so expect slow replies to issues and no new features for now.

What you need

  • A 64-bit PC running Windows, Linux or macOS. Demucs isn't supported on 32-bit systems.

  • uv, the Python tool manager. The Demucs docs now use it for everything, and it installs Python for you (Demucs needs Python 3.10 or newer). We have a separate guide on using uv for local AI tools. Plain pip install -U demucs still works if you prefer.

  • Optionally, ffmpeg, which you'll need for FLAC output and for unusual audio formats. WAV, FLAC, MP3, OGG and AAC files are read natively. Windows users can follow our FFmpeg install guide.

  • Optionally, an NVIDIA graphics card. Per the README, you need at least 3GB of graphics memory, but about 7GB with the default settings. Without a GPU, Demucs runs on the CPU, and the README estimates processing time at roughly 1.5 times the length of the track.

The docs only describe GPU acceleration for NVIDIA cards (CUDA) and Apple Silicon Macs (Metal). There are no instructions for AMD Radeon or Intel Arc, so on those cards plan to use the CPU.

Step 1: Install uv (and ffmpeg)

  • Windows: open a terminal and run winget install --id=astral-sh.uv -e. For ffmpeg, winget install ffmpeg.

  • Linux: run curl -LsSf https://astral.sh/uv/install.sh | sh or install uv from your distribution's packages, then sudo apt-get install ffmpeg on Ubuntu or Debian.

  • macOS: brew install uv and, optionally, brew install ffmpeg.

Step 2: Separate your first track

You don't need to install Demucs at all to try it. From a terminal, run:

uvx demucs "my music/my favourite track.mp3"

uv fetches Demucs and its dependencies the first time, then Demucs downloads its default model, htdemucs. Put the path in quotes if it contains spaces; on Windows, dragging a file into the terminal window fills in the path for you.

The results land in separated/htdemucs/<track name>/ as four stereo 44.1kHz WAV files: drums.wav, bass.wav, other.wav and vocals.wav. On Windows, explorer separated opens the folder.

To keep Demucs installed as a normal command, run uv tool install demucs, after which demucs works on its own.

Step 3: Use your NVIDIA GPU (Windows)

On Linux, the default PyTorch package includes CUDA support, so an NVIDIA card with recent drivers is used automatically. On Apple Silicon Macs, Demucs uses the GPU through Metal (MPS).

Windows is the exception: the default PyTorch package there is CPU-only. The Windows support page tells you to install Demucs from PyTorch's CUDA index instead:

uv tool install demucs --index https://download.pytorch.org/whl/cu126
demucs "PATH_TO_AUDIO_FILE"

The page also points you to the PyTorch website to find the index URL that matches your CUDA version, which is worth checking if you have a newer RTX 50-series card. If Demucs still runs on the CPU, our guide to fixing "PyTorch CUDA not available" covers the usual causes.

Step 4: Choose a model and options

Pick a model with -n. The README lists these:

Model

What it is

htdemucs

Hybrid Transformer Demucs (v4), trained on MusDB plus 800 songs. The default

htdemucs_ft

Fine-tuned htdemucs. Takes four times longer "but might be a bit better"

htdemucs_6s

Six stems, adding guitar and piano. The developer says piano "is not working great"

hdemucs_mmi

Hybrid Demucs v3, retrained on MusDB plus 800 songs

mdx, mdx_extra

Older models from the MDX challenge (mdx won track A)

mdx_q, mdx_extra_q

Quantised versions: smaller downloads, quality "can be slightly worse". Need "demucs[quantized]"

The researchers' own figures put the fine-tuned v4 model at 9.0dB SDR (a standard separation quality score, where higher is better) on the MUSDB HQ test set, against 7.7dB for Hybrid Demucs v3 and 5.9dB for Spleeter.

The options most people will use:

  • --two-stems=vocals gives you just vocals.wav and no_vocals.wav (karaoke mode). You can swap vocals for drums or bass. The README notes this mixes the stems after a full separation, so it isn't faster and doesn't save memory.

  • --flac saves FLAC (needs ffmpeg), --mp3 saves MP3 at 320kbps by default (change it with --mp3-bitrate), and --int24 or --float32 give higher-resolution WAV files than the default 16-bit.

  • --shifts=N averages several predictions for a slightly better result but makes it N times slower; the README says don't use it without a GPU.

  • --overlap defaults to 0.25. The README says dropping it to 0.1 can speed things up a little.

  • --clip-mode clamp stops Demucs rescaling stems to avoid clipping, which keeps their relative volumes intact.

For example, a high-quality karaoke track as FLAC:

uvx demucs -n htdemucs_ft --two-stems=vocals --flac "track.mp3"

Step 5: Fix out-of-memory errors

If your GPU runs out of memory, the README suggests three things, in this order:

  1. Add --segment 7 or a smaller whole number to split the song into shorter chunks. The Hybrid Transformer models support a maximum segment length of 7.8 seconds, and the README suggests 8 for older models if you only have 3GB of graphics memory.

  2. Set the environment variable PYTORCH_NO_CUDA_MEMORY_CACHING=1. The developer says that let him separate a 4-minute track using only 1.5GB, though more slowly.

  3. Add -d cpu to run on the processor instead.

Our guide to fixing CUDA out-of-memory errors has more general tips. Avoid the -j flag (parallel jobs) on low-memory PCs, as it multiplies RAM use.

Step 6: Batch a whole folder

On Windows, from inside the folder in Command Prompt:

for %i in (*.mp3) do (uvx demucs "%i")

Or simply pass several files at once: demucs track1.mp3 track2.mp3. Demucs can also be called from Python with demucs.separate.main([...]), using the same options as the command line.

If you'd rather click than type, the README points to the third-party Demucs GUI by CarlGao4, and to Ultimate Vocal Remover, which includes Demucs. Our UVR guide covers that route, and our Demucs vs UVR comparison helps you choose.

The bottom line

Demucs 4.1 is the simplest way to split songs into drums, bass, vocals and other from the command line: install uv, run uvx demucs on a track and collect the stems from the separated folder. On Windows, install it from PyTorch's CUDA index to use an NVIDIA card, and use --segment or -d cpu if you run out of memory. The maintainer isn't adding new features, but 4.1.0 from July 2026 is current. Forge PC hasn't tested it.

In this article

Sources

  1. 01Alexandre Défossez, Demucs GitHub README
  2. 02Alexandre Défossez, Demucs Windows support
  3. 03Alexandre Défossez, Demucs Linux support
  4. 04Alexandre Défossez, Demucs macOS support
  5. 05Alexandre Défossez, Demucs release notes
  6. 06Python Package Index, demucs release history

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Fix VIDEO_MEMORY_MANAGEMENT_INTERNAL on Windows 11

How-To

How to Fix VIDEO_MEMORY_MANAGEMENT_INTERNAL on Windows 11

VIDEO_MEMORY_MANAGEMENT_INTERNAL (0x10E) means Windows' video memory manager hit a condition it couldn't recover from, and Microsoft says a misbehaving video driver is the usual cause. Here's how to read Parameter 1, then update, roll back or clean-install the driver and rule out other causes.

Marcus Thorne4 min

How to Fix VIDEO_DXGKRNL_FATAL_ERROR on Windows 11

How-To

How to Fix VIDEO_DXGKRNL_FATAL_ERROR on Windows 11

VIDEO_DXGKRNL_FATAL_ERROR (0x113) means Windows' DirectX graphics kernel detected a violation. Here's how to undo recent changes, use safe mode, roll back, update or clean-install the graphics driver, rule out GPU tuning and hardware, and read the minidump to find the cause.

Marcus Thorne5 min

Best Free Scanning Software for Windows (2026)

Best Picks

Best Free Scanning Software for Windows (2026)

The best free scanning software for Windows, ranked: NAPS2, PDF24 Creator, Windows Scan and Windows Fax and Scan. We explain which save searchable PDFs, which work with network scanners, and who each one suits.

Hannah Vance5 min