From 70c45881972155f3be83737711321c877f995ee3 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 5 May 2022 14:11:30 +0200 Subject: [PATCH] Add compute capability of first device as arch property Signed-off-by: Evan Lezar --- cmd/nvidia-container-runtime/modifier/experimental.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/nvidia-container-runtime/modifier/experimental.go b/cmd/nvidia-container-runtime/modifier/experimental.go index 4993c147..0bf73bd8 100644 --- a/cmd/nvidia-container-runtime/modifier/experimental.go +++ b/cmd/nvidia-container-runtime/modifier/experimental.go @@ -170,6 +170,13 @@ func checkRequirements(logger *logrus.Logger, image *image.CUDA) error { r.AddVersionProperty(requirements.CUDA, cudaVersion) } + compteCapability, err := cuda.ComputeCapability(0) + if err != nil { + logger.Warnf("Failed to get CUDA Compute Capability: %v", err) + } else { + r.AddVersionProperty(requirements.ARCH, compteCapability) + } + return r.Assert() }