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 new NVIDIA CUDA feature #80

Merged
merged 38 commits into from
Aug 21, 2022
Merged

Add new NVIDIA CUDA feature #80

merged 38 commits into from
Aug 21, 2022

Conversation

jungaretti
Copy link
Contributor

@jungaretti jungaretti commented Aug 4, 2022

Adds a new feature that installs Nvidia's CUDA and cuDNN libraries. These libraries enable tools such as TensorFlow to leverage an Nvidia GPU to perform highly-parallelizable tasks.

Motivation

This new feature would dramatically decrease friction for developers who use Codespaces to work on machine learning projects. Instead of copying, pasting, and executing this script, developers could simply add the new nvidia feature to their devcontainer.json and rebuild their codespace.

Changes

  • Added a new Nvidia feature
  • Added a test for the new feature
  • Added two scenario tests for the new feature

@jungaretti jungaretti requested a review from a team as a code owner August 4, 2022 22:48
test/nvidia/test.sh Outdated Show resolved Hide resolved
src/nvidia/devcontainer-feature.json Outdated Show resolved Hide resolved
src/nvidia/install.sh Outdated Show resolved Hide resolved
@jungaretti jungaretti changed the title Add new Nvidia feature Add new NVIDIA CUDA feature Aug 8, 2022
src/nvidia-cuda/devcontainer-feature.json Outdated Show resolved Hide resolved
src/nvidia-cuda/devcontainer-feature.json Outdated Show resolved Hide resolved
src/nvidia-cuda/install.sh Outdated Show resolved Hide resolved
src/nvidia-cuda/install.sh Outdated Show resolved Hide resolved
@Chuxel
Copy link
Member

Chuxel commented Aug 10, 2022

There's a bit of a gap in the dev container spec for features that is needed here. Specifically, there's no way that I'm aware of for a feature to specify GPU usage - which I'd expect you'd want for this feature, correct? Is there any reason to use this feature without it?

EDIT: Raised devcontainers/spec#82

@jungaretti
Copy link
Contributor Author

jungaretti commented Aug 11, 2022

Specifically, there's no way that I'm aware of for a feature to specify GPU usage - which I'd expect you'd want for this feature, correct? Is there any reason to use this feature without it?

Not really. These libraries enable tools to leverage NVIDIA GPUs. That said, you can successfully install this feature without a GPU, but it won't be too useful.

@jungaretti
Copy link
Contributor Author

This PR is ready for another set of eyes! Here are my notable changes:

  • Added more helpful error messages when package installation fails. This feature prints an error message with the failed package (for example, libcudnn8=8.5.0.96-1+cuda11.7) and a link to NVIDIA's package repo.
  • Added support for installing a certain version of CUDA and cuDNN. Unfortunately, NVIDIA's package names include their minor version number (for example, cuda-libraries-11-7). I've hardcoded the latest CUDA and cuDNN versions, but I'm open to more elegant solutions. This problem has existed since my first commit.
  • Pivoted to always using NVIDIA's Ubuntu 20.04 package repo. I've found a lot of inconsistency among NVIDIA's Debian and Ubuntu repos. The Ubuntu 20.04 packages work perfectly on every image I've tested (Debian 10, Debian 11, Ubuntu 18, Ubuntu 20, Ubuntu 22). Another approach here would be to fail package installation with the more helpful error message.

Failed to install cuda-libraries-11-9. See https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 for all available packages and versions.

joshspicer
joshspicer previously approved these changes Aug 18, 2022
@joshspicer joshspicer merged commit ea030fa into main Aug 21, 2022
@joshspicer joshspicer deleted the jungaretti/nvidia-feature branch August 21, 2022 18:22
@jungaretti jungaretti self-assigned this Aug 22, 2022
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.

7 participants