-
Notifications
You must be signed in to change notification settings - Fork 102
Add Ubuntu 26.04 driver container with package-based driver install #857
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| ARG BASE_IMAGE=ubuntu:resolute-20260707 | ||
|
|
||
| FROM ${BASE_IMAGE} AS build | ||
|
|
||
| ARG TARGETARCH | ||
| ARG GOLANG_VERSION | ||
|
|
||
| # Arg to indicate if driver type is either of passthrough(baremetal) or vgpu | ||
| ARG DRIVER_TYPE=passthrough | ||
| ENV DRIVER_TYPE=$DRIVER_TYPE | ||
|
|
||
| SHELL ["/bin/bash", "-c"] | ||
|
|
||
| RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| apt-utils \ | ||
| build-essential \ | ||
| ca-certificates \ | ||
| curl \ | ||
| git \ | ||
| wget && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # download appropriate binary based on the target architecture for multi-arch builds | ||
| RUN OS_ARCH=${TARGETARCH/x86_64/amd64} && OS_ARCH=${OS_ARCH/aarch64/arm64} && \ | ||
| wget -nv -O - https://go.dev/dl/go${GOLANG_VERSION}.linux-${OS_ARCH}.tar.gz \ | ||
| | tar -C /usr/local -xz | ||
|
|
||
| ENV PATH=/usr/local/go/bin:$PATH | ||
|
|
||
| WORKDIR /work | ||
|
|
||
| RUN if [ "$DRIVER_TYPE" = "vgpu" ]; then \ | ||
| git clone https://github.com/NVIDIA/gpu-driver-container driver && \ | ||
| cd driver/vgpu/src && \ | ||
| go build -o vgpu-util && \ | ||
| mv vgpu-util /work; fi | ||
|
|
||
| FROM ${BASE_IMAGE} | ||
|
|
||
| SHELL ["/bin/bash", "-c"] | ||
|
|
||
| ARG TARGETARCH | ||
| ENV TARGETARCH=$TARGETARCH | ||
| ARG DRIVER_VERSION | ||
| ARG GIT_COMMIT | ||
| ENV DRIVER_VERSION=$DRIVER_VERSION | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Arg to indicate if driver type is either of passthrough(baremetal) or vgpu | ||
| ARG DRIVER_TYPE=passthrough | ||
| ENV DRIVER_TYPE=$DRIVER_TYPE | ||
| ARG DRIVER_BRANCH=595 | ||
| ENV DRIVER_BRANCH=$DRIVER_BRANCH | ||
| ARG VGPU_LICENSE_SERVER_TYPE=NLS | ||
| ENV VGPU_LICENSE_SERVER_TYPE=$VGPU_LICENSE_SERVER_TYPE | ||
| # Enable vGPU version compability check by default | ||
| ARG DISABLE_VGPU_VERSION_CHECK=true | ||
| ENV DISABLE_VGPU_VERSION_CHECK=$DISABLE_VGPU_VERSION_CHECK | ||
| ENV NVIDIA_VISIBLE_DEVICES=void | ||
|
|
||
| RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | ||
|
|
||
| RUN echo "TARGETARCH=$TARGETARCH" | ||
|
|
||
| ADD install.sh /tmp | ||
|
|
||
| RUN usermod -o -u 0 -g 0 _apt && \ | ||
| /tmp/install.sh depinstall | ||
|
|
||
| # Install the driver payload for passthrough/baremetal types; the vgpu type installs from a | ||
| # .run file at container start | ||
| RUN /tmp/install.sh driver_pkgs_install | ||
|
|
||
| COPY nvidia-driver /usr/local/bin | ||
|
|
||
| COPY --from=build /work/vgpu-util* /usr/local/bin | ||
|
|
||
| ADD drivers drivers/ | ||
|
|
||
| WORKDIR /drivers | ||
|
|
||
| # Install / upgrade packages here that are required to resolve CVEs | ||
| ARG CVE_UPDATES | ||
| RUN if [ -n "${CVE_UPDATES}" ]; then \ | ||
| apt-get update && apt-get --only-upgrade -y install ${CVE_UPDATES} && \ | ||
| rm -rf /var/lib/apt/lists/*; \ | ||
| fi | ||
|
|
||
| LABEL io.k8s.display-name="NVIDIA Driver Container" | ||
| LABEL name="NVIDIA Driver Container" | ||
| LABEL vendor="NVIDIA" | ||
| LABEL version="${DRIVER_VERSION}" | ||
| LABEL vcs-ref="${GIT_COMMIT}" | ||
| LABEL release="N/A" | ||
| LABEL summary="Provision the NVIDIA driver through containers" | ||
| LABEL description="See summary" | ||
|
|
||
| ENTRYPOINT ["nvidia-driver", "init"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Ubuntu 26.04 | ||
|
|
||
| Driver container for Ubuntu 26.04. | ||
|
|
||
| For the passthrough/baremetal driver type, the NVIDIA driver is installed from the NVIDIA CUDA | ||
| APT repository (`ubuntu2604`) instead of the `.run` installer: | ||
|
|
||
| - At image build, the version-specific `nvidia-driver-pinning-<version>` package pins the whole | ||
| driver tree to `DRIVER_VERSION`, the full driver userspace is preinstalled into the image, and | ||
| the kernel module packages are baked into a local `file:` APT repo. The CUDA network repository | ||
| is then removed from the APT sources. | ||
| - At container start, the kernel headers for the running kernel are installed, then the driver | ||
| metapackage (`nvidia-open` for `KERNEL_MODULE_TYPE=open`/`auto`, `cuda-drivers` for | ||
| `proprietary`) is installed from the local repo and DKMS builds the kernel modules. Network | ||
| access is needed only for the kernel headers. | ||
|
|
||
| The vGPU driver type continues to install from a user-supplied `.run` file placed in `drivers/`. | ||
|
|
||
| See https://github.com/NVIDIA/nvidia-docker/wiki/Driver-containers-(Beta) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Folder for downloading vGPU drivers and dependent metadata files |
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.