Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Add Python devcontainer with CUDA support #1176

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

Conversation

twsl
Copy link

@twsl twsl commented Nov 28, 2021

Adds a devcontainer based on the Python devcontainer with CUDA support.
Uses the nvidia/cuda image as base image.
Enables developers with focus on ML/DL to leverage devcontainers.

Could fix #180

@ghost
Copy link

ghost commented Nov 28, 2021

CLA assistant check
All CLA requirements met.

@twsl
Copy link
Author

twsl commented Dec 4, 2021

Hey @Chuxel, can I get some feedback on the PR?

@twsl twsl mentioned this pull request Apr 4, 2022
@mimoralea
Copy link

Please, feedback on this would be appreciated!

@Chuxel
Copy link
Member

Chuxel commented Apr 5, 2022

A few thoughts looking at this that partly caused some delay in response:

  1. One challenge is that this would only work on Linux and WSL and specifically with an Nvidia GPU. The challenge is that there is really not a great way to set that expectation in the existing user experience. It would need to be directly in name in devcontainer.json for it to appear - so we'd definitely want to set that expectation. There is an upcoming capability that could allow for two definitions that you can pick from - one GPU, one w/o a GPU - but I'm assuming that wouldn't work here, correct? Otherwise, it might make sense to wait for that to be available.

  2. As this is setup right now, it seems to assume that Microsoft would pick up pre-building the image as well. That's a higher bar for merging since it has long term implications for support, patching, etc. It might be better to refactor this so that the "base.Dockerfile" is the Dockerfile and updating the README to make this a bit clearer. Generally we've been adding (Community) by community managed definitions both in the README and devcontainer.json name as well.

  3. Is installing Node.js needed in this case if the focus is ML?

@twsl
Copy link
Author

twsl commented Apr 5, 2022

Hey @Chuxel
the first issue you raised is just the harsh truth: NVIDIA and CUDA dominate the field of machine learning. Most people in the field who could leverage such a container are already used to that and I don't think it would cause wrong expectations.
I'd like to add macOS support though, but I do not have any experience with that at all and do not own a mac for testing.
The mentioned capability could simplify the user experience because this is intended as a an addition to the base python container.
I only skimmed over the linked issue, but I think if the cuda option can include the usage of a gpu and a different image, it would be a good example for said capability.
Given that I copied most of the files from the base python image, it might make sense, but I do not have a firm opinion on that matter.

What exactly is required for the refactor, any specific changes you have in mind? Feel free to request changes in a review.
Especially if this devcontainer should utilize the linked upcoming capability, I do not know how to structure the files.

Node.js has been added for parity with the base python devcontainer, so a developer can simply switch to the cuda devcontainer without breaking existing code. Workloads such as data visualization can require node.js.

@mkarikom
Copy link

@twsl your base.Dockerfile is working brilliantly, thanks!

@sidecus
Copy link

sidecus commented Jul 21, 2023

@Chuxel @twsl any update on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Pytorch example
5 participants