From 2b7129f413789c4ae799f6670b19327b852fc673 Mon Sep 17 00:00:00 2001 From: Gabriel Mougard Date: Thu, 20 Jun 2024 14:05:15 +0200 Subject: [PATCH] snapcraft: Add `nvidia-ctk` as part of the binary tool for Container Device Interface spec generation Signed-off-by: Gabriel Mougard --- snapcraft.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/snapcraft.yaml b/snapcraft.yaml index b8808717e..c7280801e 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -650,6 +650,32 @@ parts: - bin/nvidia-container-cli* - lib/libnvidia-container*.so* + nvidia-container-toolkit: + source: https://github.com/NVIDIA/nvidia-container-toolkit + source-depth: 1 + source-commit: a470818ba7d9166be282cd0039dd2fc9b0a34d73 # v1.16.1 + source-type: git + build-snaps: + - go + plugin: make + override-prime: |- + [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0 + craftctl default + override-pull: |- + [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0 + craftctl default + override-build: |- + [ "$(uname -m)" != "x86_64" ] && [ "$(uname -m)" != "aarch64" ] && [ "$(uname -m)" != "ppc64le" ] && [ "$(uname -m)" != "s390x" ] && exit 0 + set -ex + + make binaries + mkdir -p "${CRAFT_PART_INSTALL}/bin/" + cp nvidia-ctk "${CRAFT_PART_INSTALL}/bin/" + organize: + usr/bin/: bin/ + prime: + - bin/nvidia-ctk + nvme: plugin: nil stage-packages: @@ -1479,6 +1505,7 @@ parts: - criu - lxd - shmounts + - nvidia-container-toolkit plugin: nil override-prime: | set -x