-
Notifications
You must be signed in to change notification settings - Fork 59
Amazon linux support #127
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
Open
shivakunv
wants to merge
1
commit into
main
Choose a base branch
from
amazonlinuxsupport
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Amazon linux support #127
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| FROM nvcr.io/nvidia/cuda:12.6.2-base-amzn2023 AS build | ||
|
|
||
| ARG TARGETARCH | ||
|
|
||
| SHELL ["/bin/bash", "-c"] | ||
|
|
||
| # Remove cuda repository to avoid GPG errors | ||
| RUN rm -f /etc/yum.repos.d/cuda* | ||
|
|
||
| RUN dnf update -y && dnf makecache && \ | ||
| dnf install -y \ | ||
| gcc \ | ||
| gcc-c++ \ | ||
| make \ | ||
| ca-certificates \ | ||
| git \ | ||
| tar && \ | ||
| dnf clean all && rm -rf /var/cache/yum/* | ||
|
|
||
| ENV GOLANG_VERSION=1.23.2 | ||
|
|
||
| # download appropriate binary based on the target architecture for multi-arch builds | ||
| RUN curl https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${TARGETARCH}.tar.gz \ | ||
| | tar -C /usr/local -xz | ||
|
|
||
| ENV PATH /usr/local/bin:$PATH | ||
| 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-amzn2023 | ||
|
|
||
| SHELL ["/bin/bash", "-c"] | ||
|
|
||
| ARG BASE_URL=https://us.download.nvidia.com/tesla | ||
| ARG TARGETARCH | ||
| ENV TARGETARCH=$TARGETARCH | ||
| ENV DRIVER_ARCH=${TARGETARCH/amd64/x86_64} | ||
| ARG DRIVER_VERSION | ||
| ENV DRIVER_VERSION=$DRIVER_VERSION | ||
|
|
||
| # 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=560 | ||
| 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 "TARGETARCH=$TARGETARCH" | ||
|
|
||
| ADD install.sh /tmp | ||
|
|
||
| RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \ | ||
| curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/${DRIVER_ARCH}/D42D0685.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \ | ||
| echo "$NVIDIA_GPGKEY_SUM /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" | sha256sum -c --strict - && \ | ||
| curl -fsSL -o /etc/yum.repos.d/cuda.repo https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/${DRIVER_ARCH}/cuda-amzn2023.repo | ||
|
|
||
| RUN dnf clean all && dnf makecache && dnf update -y && dnf install -y shadow-utils | ||
| 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 | ||
|
|
||
| RUN curl -fsSL -o /usr/local/bin/extract-vmlinux https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux && \ | ||
shivakunv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| chmod +x /usr/local/bin/extract-vmlinux | ||
|
|
||
| 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 | ||
|
|
||
| # Check for nvidia-fabric-manager or nvidia-fabricmanager availability and install | ||
| RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$TARGETARCH" != "arm64" ]; then \ | ||
| dnf install -y nvidia-fabric-manager-${DRIVER_VERSION}-1 libnvidia-nscq-${DRIVER_BRANCH}-${DRIVER_VERSION}-1; fi | ||
|
|
||
| WORKDIR /drivers | ||
|
|
||
| ARG PUBLIC_KEY=empty | ||
| COPY ${PUBLIC_KEY} kernel/pubkey.x509 | ||
|
|
||
| # Remove cuda repository to avoid GPG errors | ||
| # clean cache | ||
| # Add NGC DL license from the CUDA image | ||
| RUN rm -f /etc/yum.repos.d/cuda* && dnf clean all && \ | ||
| 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 @@ | ||
| # AmazonLinux2 [](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,58 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -eu | ||
|
|
||
| download_installer () { | ||
| DRIVER_ARCH=${TARGETARCH/amd64/x86_64} && 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 | ||
| DRIVER_ARCH=${TARGETARCH/amd64/x86_64} | ||
| dnf update -y && dnf install -y \ | ||
| gcc \ | ||
| make \ | ||
| glibc-devel \ | ||
| ca-certificates \ | ||
| kmod \ | ||
| file \ | ||
| elfutils-libelf-devel \ | ||
| libglvnd-devel \ | ||
| shadow-utils \ | ||
| util-linux \ | ||
| tar \ | ||
| rpm-build \ | ||
| dnf-utils \ | ||
| pkgconfig && \ | ||
| dnf clean all && \ | ||
| rm -rf /var/cache/yum/* | ||
| fi | ||
| } | ||
|
|
||
| repo_setup () { | ||
| if [ "$TARGETARCH" = "amd64" ]; then | ||
| echo "[cuda-amzn2023-x86_64] | ||
| name=cuda-amzn2023-x86_64 | ||
| baseurl=https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/$DRIVER_ARCH | ||
| enabled=1 | ||
| gpgcheck=1 | ||
| gpgkey=https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/$DRIVER_ARCH/D42D0685.pub" > /etc/yum.repos.d/cuda.repo && \ | ||
| usermod -o -u 0 -g 0 nobody | ||
| 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.