Two solutions to the Demucs lack of video memory
When using Demucs to process high-resolution audio, you may encounter problems with insufficient video memory on your graphics card. Here are two solutions:
Option 1: Optimize processing parameters
- utilization
--segment 8
parameter to reduce memory requirements, which splits the audio into 8-second segments for processing - increase
--two-stems
Parameters extract only specific tracks (e.g., vocals only), reducing the amount of computation - utilization
-j 4
Parameter-enabled multi-core CPU auxiliary computation to share GPU pressure
Option 2: Switching computing devices
- Force CPU calculations: add
-d cpu
parameters - Setting environment variables
PYTORCH_NO_CUDA_MEMORY_CACHING=1
Disable CUDA memory cache - For Mac users, the
-d mps
Enable Apple Metal acceleration
Additional tip: Reducing the sampling rate of WAV files to 44.1kHz can also significantly reduce memory consumption. It is recommended to prioritize CPU solutions when the video memory is below 3GB.
This answer comes from the articleDemucs: free open source tool for separating music tracksThe