Skip to content

Improved CUDA device selection (computer capability >= 700, pick card if several) #172

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

coezbek
Copy link
Contributor

@coezbek coezbek commented Mar 4, 2025

When running Zonos with CPU on Laptops/PCs with old CUDA hardware (before RTX 2000) then Zonos will not work. The patch only enables CUDA if compute capabilities are 7.0 or higher.

@Ph0rk0z
Copy link

Ph0rk0z commented Mar 11, 2025

Did anyone test on P40 and P100 to push such a change? Mobile GPU are in general not suited to this. Plus you can get rid of BF16 use.

@coezbek coezbek changed the title Only use CUDA if device supports compute >= 700 Improved CUDA device selection (computer capability >= 700, pick card if several) Mar 20, 2025
@coezbek
Copy link
Contributor Author

coezbek commented Mar 20, 2025

Improved the patch to include support for picking either the faster GPU or the one with more VRAM.

@tjameswilliams
Copy link

This is a good idea, but for my use case, I would not want it to be the default. For instance I feel like Zonos will be used frequently alongside an LLM, in which case you want the LLM to take the faster / larger compute GPU by default.

@coezbek
Copy link
Contributor Author

coezbek commented Mar 20, 2025

I have added the two options because these two options for me allow me to select my two cards (faster 4060, more RAM 3090). But you are right, that smallest and slowest also should be options to select. I guess you can always just override with "cuda:0" and "cuda:1".

@Ph0rk0z
Copy link

Ph0rk0z commented Mar 20, 2025

Have you ever heard of CUDA_VISIBLE_DEVICES?

@coezbek
Copy link
Contributor Author

coezbek commented Mar 20, 2025

I have not until now.

https://stackoverflow.com/questions/39649102/how-do-i-select-which-gpu-to-run-a-job-on

Thanks for the pointer.

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.

3 participants