Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-gpu support, model cache, fix README and deprecated containers #60

Merged
merged 7 commits into from
May 5, 2024

Conversation

catid
Copy link
Contributor

@catid catid commented May 3, 2024

This adds several improvements:
[x] Support for consumer GPUs for hosting
[x] Local model cache for docker container to avoid re-downloading the models on restart
[x] Fixes for deprecated container images and README corrections

@bluestyle97
Copy link
Member

Hi, thanks for you contribution! Could you please add a new app_2gpu.py instead of editing the original app.py directly and then make a new pull request?

@catid
Copy link
Contributor Author

catid commented May 3, 2024

No I think it makes more sense in app.py for use with gradio containers. I want to be able to just deploy this not manually run a different app

@bluestyle97
Copy link
Member

I think using separate scripts for different environments can better empowers users to choose between using a single GPU or multiple GPUs.

@catid
Copy link
Contributor Author

catid commented May 3, 2024

Don't see your point.. either way you'd want to use CUDA_VISIBLE_DEVICES=0 to do what you're saying. So might as well just have one script

@catid
Copy link
Contributor Author

catid commented May 3, 2024

And for the docker container you can enforce single GPU usage like this:

docker run -it -p 43839:43839 --platform=linux/amd64 --gpus '"device=0"' -v $HOME/models/:/workspace/instantmesh/models instantmesh

@catid
Copy link
Contributor Author

catid commented May 3, 2024

So there's no reason to have a ton of ugly code duplication for this feature.. Even if you wanted to select it via script features it's better to have an argparse --argument instead

@catid catid changed the title Add multi-gpu support Add multi-gpu support, model cache, fix README and deprecated containers May 3, 2024
@bluestyle97
Copy link
Member

Ok, I get your point and agree with you. Before merging the commits, I notice that the CUDA version in the docker file is upgraded from 12.1 to 12.4, while pytorch 2.1.0 is compiled with CUDA 12.1 by default. Will the change of CUDA version potentially lead to incompatible problem? How about keeping the original CUDA version unchanged?

@catid
Copy link
Contributor Author

catid commented May 4, 2024

Sometimes it can lead to problems but I tested it and it's working great. Also I regularly run 12.4.1 on all my Ubuntu GPU servers so I have some trust in this version of CUDA. I have had issues with prior versions so I know somewhat what to look out for (usually wheel build errors from nvcc).

@bluestyle97 bluestyle97 merged commit 5dcb994 into TencentARC:main May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants