-
Notifications
You must be signed in to change notification settings - Fork 61
add ubuntu24.04 driver container #124
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
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
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,109 @@ | ||
| FROM nvcr.io/nvidia/cuda:12.6.2-base-ubuntu24.04 as build | ||
|
|
||
| ARG TARGETARCH | ||
| ARG GOLANG_VERSION | ||
|
|
||
| SHELL ["/bin/bash", "-c"] | ||
|
|
||
| RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections | ||
|
|
||
| # Remove cuda repository to avoid GPG errors | ||
| RUN rm -f /etc/apt/sources.list.d/cuda* | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| apt-utils \ | ||
| build-essential \ | ||
| ca-certificates \ | ||
| curl \ | ||
| git && \ | ||
| 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} && \ | ||
| curl https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${OS_ARCH}.tar.gz \ | ||
| | tar -C /usr/local -xz | ||
|
|
||
| ENV PATH /usr/local/go/bin:$PATH | ||
|
|
||
| WORKDIR /work | ||
|
|
||
| RUN git clone https://github.com/NVIDIA/gpu-driver-container driver && \ | ||
| cd driver/vgpu/src && \ | ||
| go build -o vgpu-util && \ | ||
| mv vgpu-util /work | ||
|
|
||
| FROM nvcr.io/nvidia/cuda:12.6.2-base-ubuntu24.04 | ||
|
|
||
| SHELL ["/bin/bash", "-c"] | ||
|
|
||
| ARG BASE_URL=https://us.download.nvidia.com/tesla | ||
| ARG TARGETARCH | ||
| ENV TARGETARCH=$TARGETARCH | ||
| ARG DRIVER_VERSION | ||
| 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=550 | ||
| 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 | ||
|
|
||
| # Fetch GPG keys for CUDA repo | ||
| RUN apt-key del 7fa2af80 && OS_ARCH=${TARGETARCH/amd64/x86_64} && OS_ARCH=${OS_ARCH/arm64/sbsa} && \ | ||
| apt-key adv --fetch-keys "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/${OS_ARCH}/3bf863cc.pub" | ||
|
|
||
| RUN /tmp/install.sh reposetup && /tmp/install.sh depinstall && \ | ||
| curl -fsSL -o /usr/local/bin/donkey https://github.com/3XX0/donkey/releases/download/v1.1.0/donkey && \ | ||
| chmod +x /usr/local/bin/donkey | ||
|
|
||
| COPY nvidia-driver /usr/local/bin | ||
|
|
||
| COPY --from=build /work/vgpu-util /usr/local/bin | ||
|
|
||
| ADD drivers drivers/ | ||
|
|
||
| # Fetch the installer automatically for passthrough/baremetal types | ||
| RUN if [ "$DRIVER_TYPE" != "vgpu" ]; then \ | ||
| cd drivers && \ | ||
| /tmp/install.sh download_installer; fi | ||
|
|
||
| # Fabric manager packages are not available for arm64 | ||
| RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$TARGETARCH" != "arm64" ]; then \ | ||
| apt-get update && \ | ||
| apt-get install -y --no-install-recommends nvidia-fabricmanager-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 \ | ||
| libnvidia-nscq-${DRIVER_BRANCH}=${DRIVER_VERSION}-1; fi | ||
|
|
||
| WORKDIR /drivers | ||
|
|
||
| ARG PUBLIC_KEY=empty | ||
| COPY ${PUBLIC_KEY} kernel/pubkey.x509 | ||
|
|
||
| # Install / upgrade packages here that are required to resolve CVEs | ||
| ARG CVE_UPDATES | ||
| RUN if [ -n "${CVE_UPDATES}" ]; then \ | ||
| apt-get update && apt-get upgrade -y ${CVE_UPDATES} && \ | ||
| rm -rf /var/lib/apt/lists/*; \ | ||
| fi | ||
|
|
||
| # Remove cuda repository to avoid GPG errors | ||
| RUN rm -f /etc/apt/sources.list.d/cuda* | ||
|
|
||
| # Add NGC DL license from the CUDA image | ||
| RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE | ||
|
|
||
| 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,3 @@ | ||
| # Ubuntu 20.04 [](https://gitlab.com/nvidia/driver/commits/master) | ||
|
|
||
| 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.
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,65 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -eu | ||
|
|
||
| download_installer () { | ||
| DRIVER_ARCH=${TARGETARCH/amd64/x86_64} && DRIVER_ARCH=${DRIVER_ARCH/arm64/aarch64} && curl -fSsl -O $BASE_URL/$DRIVER_VERSION/NVIDIA-Linux-$DRIVER_ARCH-$DRIVER_VERSION.run && \ | ||
| chmod +x NVIDIA-Linux-$DRIVER_ARCH-$DRIVER_VERSION.run; | ||
| } | ||
|
|
||
| dep_install () { | ||
| if [ "$TARGETARCH" = "amd64" ]; then | ||
| dpkg --add-architecture i386 && \ | ||
| apt-get update && apt-get install -y --no-install-recommends \ | ||
| apt-utils \ | ||
| build-essential \ | ||
| ca-certificates \ | ||
| curl \ | ||
| kmod \ | ||
| file \ | ||
| libelf-dev \ | ||
| libglvnd-dev \ | ||
| pkg-config && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
| elif [ "$TARGETARCH" = "arm64" ]; then | ||
| dpkg --add-architecture arm64 && \ | ||
| apt-get update && apt-get install -y \ | ||
| build-essential \ | ||
| ca-certificates \ | ||
| curl \ | ||
| kmod \ | ||
| file \ | ||
| libelf-dev \ | ||
| libglvnd-dev && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
| fi | ||
| } | ||
|
|
||
| repo_setup () { | ||
| if [ "$TARGETARCH" = "amd64" ]; then | ||
| echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ noble main universe" > /etc/apt/sources.list && \ | ||
| echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ noble-updates main universe" >> /etc/apt/sources.list && \ | ||
| echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ noble-security main universe" >> /etc/apt/sources.list && \ | ||
| usermod -o -u 0 -g 0 _apt | ||
| elif [ "$TARGETARCH" = "arm64" ]; then | ||
| echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main universe" > /etc/apt/sources.list && \ | ||
| echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main universe" >> /etc/apt/sources.list && \ | ||
| echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main universe" >> /etc/apt/sources.list && \ | ||
| usermod -o -u 0 -g 0 _apt | ||
| else | ||
| echo "TARGETARCH doesn't match a known arch target" | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| if [ "$1" = "reposetup" ]; then | ||
| repo_setup | ||
| elif [ "$1" = "depinstall" ]; then | ||
| dep_install | ||
| elif [ "$1" = "download_installer" ]; then | ||
| download_installer | ||
| else | ||
| echo "Unknown function: $1" | ||
| exit 1 | ||
| fi | ||
|
|
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.