vscode-dev-containers
vscode-dev-containers copied to clipboard
Add Python devcontainer with CUDA support
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
Hey @Chuxel, can I get some feedback on the PR?
Please, feedback on this would be appreciated!
A few thoughts looking at this that partly caused some delay in response:
-
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.
-
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. -
Is installing Node.js needed in this case if the focus is ML?
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.
@twsl your base.Dockerfile is working brilliantly, thanks!
@Chuxel @twsl any update on this?