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

feat(wrapper): add gpu support in containers #254

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Fastiraz
Copy link

Description

Add GPU support using the torch Python module and the device_requests (--gpus in CLI) Docker argument.
To do this I implemented the isGPUAvailable function which checks for GPU availability and returns the appropriate value for Docker's --gpus argument. Finally, I added docker_args["device_requests"] to enable GPU support when creating a container.

Point of attention

I've also imported the numpy Python module but it's not required.
I imported it because of a warning message that appears when creating a new container with Exegol.

No module named numpy...

It works fine even without numpy, the error is just displayed when the module is missing.
For now, I haven't figured out how to solve this properly.

I found a way to suppress the warning using warning filters, so it doesn't print the message. Let me know if you want me to implement it this way.

Here's an example:

import warnings
warnings.filterwarnings("ignore", message="No module named numpy", category=ImportWarning)

image

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.

1 participant