[#21] Add Nvidia CUDA GPU support and additional options, update README - #24
Conversation
There was a problem hiding this comment.
Hey @chucknelson,
Thanks for your interest and enormous contribution to the repository.
Single Docker Image
I think it's a good approach taking into account that the base image supports CPU & GPU and also as you commented, we're reducing the image size which is great. 👏🏽
In addition, it's great to know that using the build-essential and the python-dev packages we're adding support for ARM64, I didn't know that! I was trying to build manually (as commented in another issue) a dependency that was crashing using ARM64 called lameenc, but it was fairly complex.
Makefile Job Parameters
I like the way each option is added, it looks simple and understandable. Also, good naming for the variables to understand if they're related to docker or the demucs CLI.
Interactive Mode
Good idea, it's nice to have the possibility to play with the different options 👌🏽
What I tested:
- amd64 & arm64 support
- CPU support
and works like a charm!! 👏🏽 👏🏽
I've just left you the comment to define the default goal for the Makefile. After applying this change I'll merge this pull request and then I'll update my branch to add the Github Action to automatically update the image we have in DockerHub with your changes so the users won't need to build manually the image, just download it.
Thanks again 🚀
No problem - thank you for having this demucs option ready to go! I just wanted an easy way to locally run demucs to get some drumless tracks without messing around with Python, CUDA, etc., and thankfully this project was called out in the Demucs readme 👍 Thanks for the feedback and looking things over, appreciate it! |
xserrat
left a comment
There was a problem hiding this comment.
Great job @chucknelson and thanks @aavetis for the first approach too 👏
I'm glad to see that the project has interested others to the point to improve it with their contributions 🙌
|
Is there Apple Chip (ex. M1 Max) gpu support available? |
Unfortunately I don't think this will be possible any time soon. It looks like Demucs isn't very active anymore and only supports GPU acceleration via CUDA (i.e., Nvidia GPUs only). It would be interesting to see if there are any python libraries that could be "plugged in" to Demucs to utilize Apple Metal APIs, but I personally haven't looked into it. |
|
Ah okay. Thanks for sharing. Would you be able to direct me to any resources/libraries that I can read into and see if it's feasible to try to figure out myself on the side? |
Looks like this issue has been discussed earlier in 2023 - you may be able to start here and eventually land on what the latest info is for full pytorch support for Apple Silicon that works with demucs... |
|
Thanks, I'll read and catch up on that previous discussion |
Hopefully closes issue #21.
Continued from the work started in PR #22 by @aavetis.
I'm going to try and see if I can convince you all that instead of two docker files and different
Makefilejobs, perhaps a single image and parameterizedMakefilejobs are simpler.Single Docker Image
I initially began doing the "two Dockerfile" option, but when building the images, I noticed that the Nvidia CUDA-based one was...actually smaller than the Python base image. After tool installation and
pip install, the image sizes turned out like this on a Windows 11 machine:So with this in mind, I just changed the
Dockerfileto the CUDA base, which supports both CPU-only (if it can't find an Nvidia GPU) and GPU. It "just works" from my testing - tested on a Windows 11 machine w/ a Ryzen 5800x and RTX 2060 Super, and an M1 Mac Mini.Makefile Job Parameters
To keep the number of jobs in the
Makefilefrom growing, I added some "options" / parameters that adjust thedocker runcommand. See theREADMEfor the documentation on them, but for GPU specifically, if you runmake run track=mysong.mp3 gpu=true, it'll try to use GPU. I also added options to output as MP3, split/separate a single track and to specify a differentdemucsmodel if desired.Interactive Mode
One last thing I added is an "interactive" job,
run-interactive, to just freely rundemucson the command line. I found this useful to experiment with otherdemucsoptions, and I think it is a simple enough thing that it doesn't pollute the simplicity of this project too much...I hope anyway.I also just did some minor readme cleanup and such - hopefully you don't mind!
Let me know what you all think - thanks!