Skip to content

Add new NVIDIA CUDA feature - #80

Merged
joshspicer merged 38 commits into
mainfrom
jungaretti/nvidia-feature
Aug 21, 2022
Merged

Add new NVIDIA CUDA feature#80
joshspicer merged 38 commits into
mainfrom
jungaretti/nvidia-feature

Conversation

@jungaretti

@jungaretti JP Ungaretti (jungaretti) commented Aug 4, 2022

Copy link
Copy Markdown
Contributor

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
JP Ungaretti (jungaretti) requested a review from a team as a code owner August 4, 2022 22:48
Comment thread src/nvidia/devcontainer-feature.json Outdated
Comment thread src/nvidia/devcontainer-feature.json Outdated
Comment thread test/nvidia/test.sh Outdated
Comment thread src/nvidia/devcontainer-feature.json Outdated
Comment thread src/nvidia/devcontainer-feature.json Outdated
Comment thread src/nvidia/install.sh Outdated
Comment thread src/nvidia/devcontainer-feature.json Outdated
@jungaretti JP Ungaretti (jungaretti) changed the title Add new Nvidia feature Add new NVIDIA CUDA feature Aug 8, 2022
Comment thread src/nvidia-cuda/devcontainer-feature.json Outdated
Comment thread src/nvidia-cuda/devcontainer-feature.json Outdated
Comment thread src/nvidia-cuda/install.sh Outdated
Comment thread src/nvidia-cuda/install.sh Outdated
@Chuxel

Chuck Lantz (Chuxel) commented Aug 10, 2022

Copy link
Copy Markdown
Member

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

Comment thread src/nvidia-cuda/install.sh
@jungaretti

JP Ungaretti (jungaretti) commented Aug 11, 2022

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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.

Comment thread src/nvidia-cuda/install.sh Outdated
joshspicer
joshspicer previously approved these changes Aug 18, 2022
Comment thread src/nvidia-cuda/install.sh Outdated
@joshspicer
joshspicer merged commit ea030fa into main Aug 21, 2022
@joshspicer
joshspicer deleted the jungaretti/nvidia-feature branch August 21, 2022 18:22
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