mirror of
https://github.com/lingble/meta-tegra.git
synced 2025-11-02 05:17:52 +00:00
external/virtualization-layer: update nvidia-container-toolkit to 1.14.5
* Added patch to support location of files in the container-passthrough tree * Added systemd service to generate the config.toml file for the container runtime during boot, so we can add the location of the passthrough tree. Signed-off-by: Ilies CHERGUI <ichergui@nvidia.com> Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
@@ -0,0 +1,251 @@
|
|||||||
|
From 4af28f6ae3cc08e28db4a498c9d35b526e5f0374 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matt Madison <matt@madison.systems>
|
||||||
|
Date: Sat, 9 Mar 2024 06:17:17 -0800
|
||||||
|
Subject: [PATCH 1/2] Add support for 'alternate' roots for tegra CSV handling
|
||||||
|
|
||||||
|
So the host OS can provide one or more trees of libraries that
|
||||||
|
should be mounted into containers, overriding the copies in
|
||||||
|
the main rootfs of the host OS.
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [oe-specific]
|
||||||
|
|
||||||
|
Signed-off-by: Matt Madison <matt@madison.systems>
|
||||||
|
---
|
||||||
|
cmd/nvidia-ctk/cdi/generate/generate.go | 7 +++
|
||||||
|
internal/config/runtime.go | 3 +-
|
||||||
|
internal/config/toml_test.go | 1 +
|
||||||
|
internal/modifier/csv.go | 1 +
|
||||||
|
internal/platform-support/tegra/csv.go | 62 +++++++++++++++++-------
|
||||||
|
internal/platform-support/tegra/tegra.go | 8 +++
|
||||||
|
pkg/nvcdi/lib-csv.go | 1 +
|
||||||
|
pkg/nvcdi/lib.go | 1 +
|
||||||
|
pkg/nvcdi/options.go | 8 +++
|
||||||
|
9 files changed, 74 insertions(+), 18 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/cmd/nvidia-ctk/cdi/generate/generate.go b/cmd/nvidia-ctk/cdi/generate/generate.go
|
||||||
|
index fd46962..89ff4cc 100644
|
||||||
|
--- a/cmd/nvidia-ctk/cdi/generate/generate.go
|
||||||
|
+++ b/cmd/nvidia-ctk/cdi/generate/generate.go
|
||||||
|
@@ -52,6 +52,7 @@ type options struct {
|
||||||
|
class string
|
||||||
|
|
||||||
|
librarySearchPaths cli.StringSlice
|
||||||
|
+ altRoots cli.StringSlice
|
||||||
|
|
||||||
|
csv struct {
|
||||||
|
files cli.StringSlice
|
||||||
|
@@ -118,6 +119,11 @@ func (m command) build() *cli.Command {
|
||||||
|
Usage: "Specify the path to search for libraries when discovering the entities that should be included in the CDI specification.\n\tNote: This option only applies to CSV mode.",
|
||||||
|
Destination: &opts.librarySearchPaths,
|
||||||
|
},
|
||||||
|
+ &cli.StringSliceFlag{
|
||||||
|
+ Name: "alt-roots",
|
||||||
|
+ Usage: "Specify alternate passthrough root to search for files when discovering the entities that should be included in the CDI specification.\n\tNote: This option only applies to CSV mode.",
|
||||||
|
+ Destination: &opts.altRoots,
|
||||||
|
+ },
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "nvidia-ctk-path",
|
||||||
|
Usage: "Specify the path to use for the nvidia-ctk in the generated CDI specification. If this is left empty, the path will be searched.",
|
||||||
|
@@ -241,6 +247,7 @@ func (m command) generateSpec(opts *options) (spec.Interface, error) {
|
||||||
|
nvcdi.WithDeviceNamer(deviceNamer),
|
||||||
|
nvcdi.WithMode(string(opts.mode)),
|
||||||
|
nvcdi.WithLibrarySearchPaths(opts.librarySearchPaths.Value()),
|
||||||
|
+ nvcdi.WithAltRoots(opts.altRoots.Value()),
|
||||||
|
nvcdi.WithCSVFiles(opts.csv.files.Value()),
|
||||||
|
nvcdi.WithCSVIgnorePatterns(opts.csv.ignorePatterns.Value()),
|
||||||
|
)
|
||||||
|
diff --git a/internal/config/runtime.go b/internal/config/runtime.go
|
||||||
|
index ed9ea64..356a9e7 100644
|
||||||
|
--- a/internal/config/runtime.go
|
||||||
|
+++ b/internal/config/runtime.go
|
||||||
|
@@ -43,7 +43,8 @@ type cdiModeConfig struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type csvModeConfig struct {
|
||||||
|
- MountSpecPath string `toml:"mount-spec-path"`
|
||||||
|
+ MountSpecPath string `toml:"mount-spec-path"`
|
||||||
|
+ AltRoots []string `toml:"alt-roots"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDefaultRuntimeConfig defines the default values for the config
|
||||||
|
diff --git a/internal/config/toml_test.go b/internal/config/toml_test.go
|
||||||
|
index e017db1..d0c47a0 100644
|
||||||
|
--- a/internal/config/toml_test.go
|
||||||
|
+++ b/internal/config/toml_test.go
|
||||||
|
@@ -72,6 +72,7 @@ default-kind = "nvidia.com/gpu"
|
||||||
|
spec-dirs = ["/etc/cdi", "/var/run/cdi"]
|
||||||
|
|
||||||
|
[nvidia-container-runtime.modes.csv]
|
||||||
|
+alt-roots = []
|
||||||
|
mount-spec-path = "/etc/nvidia-container-runtime/host-files-for-container.d"
|
||||||
|
|
||||||
|
[nvidia-container-runtime-hook]
|
||||||
|
diff --git a/internal/modifier/csv.go b/internal/modifier/csv.go
|
||||||
|
index 56adcdc..c55b6f7 100644
|
||||||
|
--- a/internal/modifier/csv.go
|
||||||
|
+++ b/internal/modifier/csv.go
|
||||||
|
@@ -72,6 +72,7 @@ func NewCSVModifier(logger logger.Interface, cfg *config.Config, image image.CUD
|
||||||
|
nvcdi.WithNVIDIACTKPath(cfg.NVIDIACTKConfig.Path),
|
||||||
|
nvcdi.WithMode(nvcdi.ModeCSV),
|
||||||
|
nvcdi.WithCSVFiles(csvFiles),
|
||||||
|
+ nvcdi.WithAltRoots(cfg.NVIDIAContainerRuntimeConfig.Modes.CSV.AltRoots),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to construct CDI library: %v", err)
|
||||||
|
diff --git a/internal/platform-support/tegra/csv.go b/internal/platform-support/tegra/csv.go
|
||||||
|
index ff2f493..45a5dca 100644
|
||||||
|
--- a/internal/platform-support/tegra/csv.go
|
||||||
|
+++ b/internal/platform-support/tegra/csv.go
|
||||||
|
@@ -43,38 +43,66 @@ func (o tegraOptions) newDiscovererFromCSVFiles() (discover.Discover, error) {
|
||||||
|
targetsByType[csv.MountSpecDev],
|
||||||
|
)
|
||||||
|
|
||||||
|
- directories := discover.NewMounts(
|
||||||
|
+ var directories []discover.Discover
|
||||||
|
+ var libraries []discover.Discover
|
||||||
|
+ var symlinks []discover.Discover
|
||||||
|
+
|
||||||
|
+ symlinkTargets := o.ignorePatterns.Apply(targetsByType[csv.MountSpecSym]...)
|
||||||
|
+ o.logger.Debugf("Filtered symlink targets: %v", symlinkTargets)
|
||||||
|
+
|
||||||
|
+ for _, altRoot := range o.altRoots {
|
||||||
|
+ directories = append(directories, discover.NewMounts(
|
||||||
|
+ o.logger,
|
||||||
|
+ lookup.NewDirectoryLocator(lookup.WithLogger(o.logger), lookup.WithRoot(altRoot)),
|
||||||
|
+ altRoot,
|
||||||
|
+ targetsByType[csv.MountSpecDir],
|
||||||
|
+ ))
|
||||||
|
+
|
||||||
|
+ // Libraries and symlinks use the same locator.
|
||||||
|
+ libraries = append(libraries, discover.NewMounts(
|
||||||
|
+ o.logger,
|
||||||
|
+ lookup.NewSymlinkLocator(lookup.WithLogger(o.logger), lookup.WithRoot(altRoot)),
|
||||||
|
+ altRoot,
|
||||||
|
+ targetsByType[csv.MountSpecLib],
|
||||||
|
+ ))
|
||||||
|
+
|
||||||
|
+ symlinks = append(symlinks, discover.NewMounts(
|
||||||
|
+ o.logger,
|
||||||
|
+ lookup.NewSymlinkLocator(lookup.WithLogger(o.logger), lookup.WithRoot(altRoot)),
|
||||||
|
+ altRoot,
|
||||||
|
+ symlinkTargets,
|
||||||
|
+ ))
|
||||||
|
+ }
|
||||||
|
+ directories = append(directories, discover.NewMounts(
|
||||||
|
o.logger,
|
||||||
|
lookup.NewDirectoryLocator(lookup.WithLogger(o.logger), lookup.WithRoot(o.driverRoot)),
|
||||||
|
o.driverRoot,
|
||||||
|
targetsByType[csv.MountSpecDir],
|
||||||
|
- )
|
||||||
|
+ ))
|
||||||
|
|
||||||
|
// Libraries and symlinks use the same locator.
|
||||||
|
- libraries := discover.NewMounts(
|
||||||
|
+ librariesInDriverRoot := discover.NewMounts(
|
||||||
|
o.logger,
|
||||||
|
o.symlinkLocator,
|
||||||
|
o.driverRoot,
|
||||||
|
targetsByType[csv.MountSpecLib],
|
||||||
|
)
|
||||||
|
-
|
||||||
|
- symlinkTargets := o.ignorePatterns.Apply(targetsByType[csv.MountSpecSym]...)
|
||||||
|
- o.logger.Debugf("Filtered symlink targets: %v", symlinkTargets)
|
||||||
|
- symlinks := discover.NewMounts(
|
||||||
|
+ libraries = append(libraries, librariesInDriverRoot)
|
||||||
|
+ symlinks = append(symlinks, discover.NewMounts(
|
||||||
|
o.logger,
|
||||||
|
o.symlinkLocator,
|
||||||
|
o.driverRoot,
|
||||||
|
symlinkTargets,
|
||||||
|
- )
|
||||||
|
- createSymlinks := o.createCSVSymlinkHooks(symlinkTargets, libraries)
|
||||||
|
-
|
||||||
|
- d := discover.Merge(
|
||||||
|
- devices,
|
||||||
|
- directories,
|
||||||
|
- libraries,
|
||||||
|
- symlinks,
|
||||||
|
- createSymlinks,
|
||||||
|
- )
|
||||||
|
+ ))
|
||||||
|
+ createSymlinks := o.createCSVSymlinkHooks(symlinkTargets, librariesInDriverRoot)
|
||||||
|
+
|
||||||
|
+ var allDiscoverers []discover.Discover
|
||||||
|
+ allDiscoverers = append(allDiscoverers, devices)
|
||||||
|
+ allDiscoverers = append(allDiscoverers, directories...)
|
||||||
|
+ allDiscoverers = append(allDiscoverers, libraries...)
|
||||||
|
+ allDiscoverers = append(allDiscoverers, symlinks...)
|
||||||
|
+ allDiscoverers = append(allDiscoverers, createSymlinks)
|
||||||
|
+ d := discover.Merge(allDiscoverers...)
|
||||||
|
|
||||||
|
return d, nil
|
||||||
|
}
|
||||||
|
diff --git a/internal/platform-support/tegra/tegra.go b/internal/platform-support/tegra/tegra.go
|
||||||
|
index ad5c5b6..12ccfce 100644
|
||||||
|
--- a/internal/platform-support/tegra/tegra.go
|
||||||
|
+++ b/internal/platform-support/tegra/tegra.go
|
||||||
|
@@ -29,6 +29,7 @@ type tegraOptions struct {
|
||||||
|
logger logger.Interface
|
||||||
|
csvFiles []string
|
||||||
|
driverRoot string
|
||||||
|
+ altRoots []string
|
||||||
|
nvidiaCTKPath string
|
||||||
|
librarySearchPaths []string
|
||||||
|
ignorePatterns ignoreMountSpecPatterns
|
||||||
|
@@ -113,6 +114,13 @@ func WithDriverRoot(driverRoot string) Option {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+// WithAltRoots sets alternate roots for file/lib/symlink lookups in the discoverer.
|
||||||
|
+func WithAltRoots(altRoots []string) Option {
|
||||||
|
+ return func(o *tegraOptions) {
|
||||||
|
+ o.altRoots = altRoots
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
// WithCSVFiles sets the CSV files for the discoverer.
|
||||||
|
func WithCSVFiles(csvFiles []string) Option {
|
||||||
|
return func(o *tegraOptions) {
|
||||||
|
diff --git a/pkg/nvcdi/lib-csv.go b/pkg/nvcdi/lib-csv.go
|
||||||
|
index 09f0b14..9cc3666 100644
|
||||||
|
--- a/pkg/nvcdi/lib-csv.go
|
||||||
|
+++ b/pkg/nvcdi/lib-csv.go
|
||||||
|
@@ -43,6 +43,7 @@ func (l *csvlib) GetAllDeviceSpecs() ([]specs.Device, error) {
|
||||||
|
d, err := tegra.New(
|
||||||
|
tegra.WithLogger(l.logger),
|
||||||
|
tegra.WithDriverRoot(l.driverRoot),
|
||||||
|
+ tegra.WithAltRoots(l.altRoots),
|
||||||
|
tegra.WithNVIDIACTKPath(l.nvidiaCTKPath),
|
||||||
|
tegra.WithCSVFiles(l.csvFiles),
|
||||||
|
tegra.WithLibrarySearchPaths(l.librarySearchPaths...),
|
||||||
|
diff --git a/pkg/nvcdi/lib.go b/pkg/nvcdi/lib.go
|
||||||
|
index f8a52c1..44e7544 100644
|
||||||
|
--- a/pkg/nvcdi/lib.go
|
||||||
|
+++ b/pkg/nvcdi/lib.go
|
||||||
|
@@ -44,6 +44,7 @@ type nvcdilib struct {
|
||||||
|
devicelib device.Interface
|
||||||
|
deviceNamer DeviceNamer
|
||||||
|
driverRoot string
|
||||||
|
+ altRoots []string
|
||||||
|
nvidiaCTKPath string
|
||||||
|
librarySearchPaths []string
|
||||||
|
|
||||||
|
diff --git a/pkg/nvcdi/options.go b/pkg/nvcdi/options.go
|
||||||
|
index 61c4c95..0157a3b 100644
|
||||||
|
--- a/pkg/nvcdi/options.go
|
||||||
|
+++ b/pkg/nvcdi/options.go
|
||||||
|
@@ -118,3 +118,11 @@ func WithLibrarySearchPaths(paths []string) Option {
|
||||||
|
o.librarySearchPaths = paths
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+// WithAltRoots sets the alternate pass-through roots.
|
||||||
|
+// This is currently only used for CSV-mode.
|
||||||
|
+func WithAltRoots(altRoots []string) Option {
|
||||||
|
+ return func(o *nvcdilib) {
|
||||||
|
+ o.altRoots = altRoots
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
From 20cbd3337c7fcda12eb5e5d38c92ad23f63a9270 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Matt Madison <matt@madison.systems>
|
|
||||||
Date: Sun, 17 Mar 2024 09:33:12 -0700
|
|
||||||
Subject: [PATCH 1/2] Fix cgo LDFLAGS for go 1.21 and later
|
|
||||||
|
|
||||||
Upstream-Status: Pending
|
|
||||||
|
|
||||||
Signed-off-by: Matt Madison <matt@madison.systems>
|
|
||||||
---
|
|
||||||
internal/cuda/cuda.go | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/internal/cuda/cuda.go b/internal/cuda/cuda.go
|
|
||||||
index 2c70a82..3fc7952 100644
|
|
||||||
--- a/internal/cuda/cuda.go
|
|
||||||
+++ b/internal/cuda/cuda.go
|
|
||||||
@@ -23,7 +23,7 @@ import (
|
|
||||||
)
|
|
||||||
|
|
||||||
/*
|
|
||||||
-#cgo LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files
|
|
||||||
+#cgo LDFLAGS: -Wl,--export-dynamic -Wl,--unresolved-symbols=ignore-in-object-files
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define CUDAAPI __stdcall
|
|
||||||
--
|
|
||||||
2.34.1
|
|
||||||
|
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
From 579e83fac59da8520ad4cdc6fb2d722cbeec13bc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matt Madison <matt@madison.systems>
|
||||||
|
Date: Mon, 11 Mar 2024 04:32:52 -0700
|
||||||
|
Subject: [PATCH 2/2] cgo LDFLAGS update for go 1.21 and later
|
||||||
|
|
||||||
|
Upstream-Status: Pending [https://github.com/NVIDIA/go-nvml/pull/79]
|
||||||
|
|
||||||
|
Signed-off-by: Matt Madison <matt@madison.systems>
|
||||||
|
---
|
||||||
|
internal/cuda/cuda.go | 2 +-
|
||||||
|
internal/dxcore/dxcore.go | 2 +-
|
||||||
|
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const.go | 2 +-
|
||||||
|
vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go | 2 +-
|
||||||
|
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/internal/cuda/cuda.go b/internal/cuda/cuda.go
|
||||||
|
index 2c70a82..3fc7952 100644
|
||||||
|
--- a/internal/cuda/cuda.go
|
||||||
|
+++ b/internal/cuda/cuda.go
|
||||||
|
@@ -23,7 +23,7 @@ import (
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
-#cgo LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files
|
||||||
|
+#cgo LDFLAGS: -Wl,--export-dynamic -Wl,--unresolved-symbols=ignore-in-object-files
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define CUDAAPI __stdcall
|
||||||
|
diff --git a/internal/dxcore/dxcore.go b/internal/dxcore/dxcore.go
|
||||||
|
index 76cc53f..05c4b45 100644
|
||||||
|
--- a/internal/dxcore/dxcore.go
|
||||||
|
+++ b/internal/dxcore/dxcore.go
|
||||||
|
@@ -17,7 +17,7 @@
|
||||||
|
package dxcore
|
||||||
|
|
||||||
|
/*
|
||||||
|
-#cgo LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files
|
||||||
|
+#cgo LDFLAGS: -Wl,--export-dynamic -Wl,--unresolved-symbols=ignore-in-object-files
|
||||||
|
#include <dxcore.h>
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
|
diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const.go
|
||||||
|
index 1a0efaf..a9a3a56 100644
|
||||||
|
--- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const.go
|
||||||
|
+++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/const.go
|
||||||
|
@@ -18,7 +18,7 @@
|
||||||
|
package nvml
|
||||||
|
|
||||||
|
/*
|
||||||
|
-#cgo LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files
|
||||||
|
+#cgo LDFLAGS: -Wl,--export-dynamic -Wl,--unresolved-symbols=ignore-in-object-files
|
||||||
|
#cgo CFLAGS: -DNVML_NO_UNVERSIONED_FUNC_DEFS=1
|
||||||
|
#include "nvml.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
diff --git a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go
|
||||||
|
index f63dfe8..bf2d6fc 100644
|
||||||
|
--- a/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go
|
||||||
|
+++ b/vendor/github.com/NVIDIA/go-nvml/pkg/nvml/nvml.go
|
||||||
|
@@ -18,7 +18,7 @@
|
||||||
|
package nvml
|
||||||
|
|
||||||
|
/*
|
||||||
|
-#cgo LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files
|
||||||
|
+#cgo LDFLAGS: -Wl,--export-dynamic -Wl,--unresolved-symbols=ignore-in-object-files
|
||||||
|
#cgo CFLAGS: -DNVML_NO_UNVERSIONED_FUNC_DEFS=1
|
||||||
|
#include "nvml.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
RUNTIME_DIRECTORY=${RUNTIME_DIRECTORY:-/run/nvidia-container-runtime}
|
||||||
|
nvidia-ctk config generate-default -o $RUNTIME_DIRECTORY/config.toml
|
||||||
|
nvidia-ctk config -c $RUNTIME_DIRECTORY/config.toml -i -set nvidia-container-runtime.modes.csv.alt-roots=@DATADIR@/nvidia-container-passthrough
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Generate NVIDIA container runtime configuration
|
||||||
|
Before=docker.service containerd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
RuntimeDirectory=nvidia-container-runtime
|
||||||
|
RuntimeDirectoryPreserve=yes
|
||||||
|
ExecStart=@LIBEXECDIR@/nvidia-container-runtime/generate-config
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -9,19 +9,13 @@ COMPATIBLE_MACHINE = "(tegra)"
|
|||||||
|
|
||||||
LICENSE = "Apache-2.0 & MIT & ISC & MPL-2.0 & (Apache-2.0 | MIT)"
|
LICENSE = "Apache-2.0 & MIT & ISC & MPL-2.0 & (Apache-2.0 | MIT)"
|
||||||
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
|
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/blang/semver/LICENSE;md5=5a3ade42a900439691ebc22013660cae \
|
file://src/${GO_IMPORT}/vendor/tags.cncf.io/container-device-interface/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/container-orchestrated-devices/container-device-interface/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \
|
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/davecgh/go-spew/LICENSE;md5=c06795ed54b2a35ebeeb543cd3a73e56 \
|
file://src/${GO_IMPORT}/vendor/github.com/davecgh/go-spew/LICENSE;md5=c06795ed54b2a35ebeeb543cd3a73e56 \
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/fsnotify/fsnotify/LICENSE;md5=68f2948d3c4943313d07e084a362486c \
|
file://src/${GO_IMPORT}/vendor/github.com/fsnotify/fsnotify/LICENSE;md5=68f2948d3c4943313d07e084a362486c \
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/hashicorp/errwrap/LICENSE;md5=b278a92d2c1509760384428817710378 \
|
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/hashicorp/go-multierror/LICENSE;md5=d44fdeb607e2d2614db9464dbedd4094 \
|
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/NVIDIA/go-nvml/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
|
file://src/${GO_IMPORT}/vendor/github.com/NVIDIA/go-nvml/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/opencontainers/runc/LICENSE;md5=435b266b3899aa8a959f17d41c56def8 \
|
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/opencontainers/runtime-spec/LICENSE;md5=b355a61a394a504dacde901c958f662c \
|
file://src/${GO_IMPORT}/vendor/github.com/opencontainers/runtime-spec/LICENSE;md5=b355a61a394a504dacde901c958f662c \
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/opencontainers/runtime-tools/LICENSE;md5=b355a61a394a504dacde901c958f662c \
|
file://src/${GO_IMPORT}/vendor/github.com/opencontainers/runtime-tools/LICENSE;md5=b355a61a394a504dacde901c958f662c \
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/opencontainers/selinux/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e \
|
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/pelletier/go-toml/LICENSE;md5=e49b63d868761700c5df76e7946d0bd7 \
|
file://src/${GO_IMPORT}/vendor/github.com/pelletier/go-toml/LICENSE;md5=e49b63d868761700c5df76e7946d0bd7 \
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/pkg/errors/LICENSE;md5=6fe682a02df52c6653f33bd0f7126b5a \
|
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/pmezard/go-difflib/LICENSE;md5=e9a2ebb8de779a07500ddecca806145e \
|
file://src/${GO_IMPORT}/vendor/github.com/pmezard/go-difflib/LICENSE;md5=e9a2ebb8de779a07500ddecca806145e \
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/sirupsen/logrus/LICENSE;md5=8dadfef729c08ec4e631c4f6fc5d43a0 \
|
file://src/${GO_IMPORT}/vendor/github.com/sirupsen/logrus/LICENSE;md5=8dadfef729c08ec4e631c4f6fc5d43a0 \
|
||||||
file://src/${GO_IMPORT}/vendor/github.com/stretchr/testify/LICENSE;md5=188f01994659f3c0d310612333d2a26f \
|
file://src/${GO_IMPORT}/vendor/github.com/stretchr/testify/LICENSE;md5=188f01994659f3c0d310612333d2a26f \
|
||||||
@@ -35,13 +29,14 @@ LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=3b83ef96387f14655fc854dd
|
|||||||
file://src/${GO_IMPORT}/vendor/sigs.k8s.io/yaml/LICENSE;md5=0ceb9ff3b27d3a8cf451ca3785d73c71 \
|
file://src/${GO_IMPORT}/vendor/sigs.k8s.io/yaml/LICENSE;md5=0ceb9ff3b27d3a8cf451ca3785d73c71 \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI = "git://github.com/NVIDIA/nvidia-container-toolkit.git;protocol=https;branch=main;destsuffix=${GO_SRCURI_DESTSUFFIX}"
|
SRC_URI = "git://github.com/NVIDIA/nvidia-container-toolkit.git;protocol=https;branch=release-1.14;destsuffix=${GO_SRCURI_DESTSUFFIX}"
|
||||||
SRCREV = "d9de4a09b8fd51a46207398199ecfeb3998ad49d"
|
SRCREV = "9ea336070134e612145d342e495f2fc616aab063"
|
||||||
|
|
||||||
SRC_URI += "\
|
SRC_URI += "\
|
||||||
file://0001-Fix-cgo-LDFLAGS-for-go-1.21-and-later.patch;patchdir=src/${GO_IMPORT} \
|
file://0001-Add-support-for-alternate-roots-for-tegra-CSV-handli.patch;patchdir=src/${GO_IMPORT} \
|
||||||
file://0002-Add-alt-root-support.patch;patchdir=src/${GO_IMPORT} \
|
file://0002-Fix-cgo-LDFLAGS-for-go-1.21-and-later.patch;patchdir=src/${GO_IMPORT} \
|
||||||
file://config.toml.in \
|
file://generate-config.sh.in \
|
||||||
|
file://nvidia-container-setup.service.in \
|
||||||
"
|
"
|
||||||
|
|
||||||
GO_IMPORT = "github.com/NVIDIA/nvidia-container-toolkit"
|
GO_IMPORT = "github.com/NVIDIA/nvidia-container-toolkit"
|
||||||
@@ -60,26 +55,30 @@ S = "${WORKDIR}/git"
|
|||||||
|
|
||||||
REQUIRED_DISTRO_FEATURES = "virtualization"
|
REQUIRED_DISTRO_FEATURES = "virtualization"
|
||||||
|
|
||||||
inherit go-mod gitpkgv features_check
|
inherit go-mod gitpkgv features_check systemd
|
||||||
|
|
||||||
do_compile() {
|
do_compile() {
|
||||||
go_do_compile
|
go_do_compile
|
||||||
sed -e's,!LOCALSTATEDIR!,${localstatedir},g' \
|
sed -e's,@DATADIR@,${datadir},g' ${UNPACKDIR}/generate-config.sh.in > ${B}/generate-config.sh
|
||||||
-e's,!BASE_SBINDIR!,${base_sbindir},g' \
|
sed -e's,@LIBEXECDIR@,${libexecdir},g' ${UNPACKDIR}/nvidia-container-setup.service.in > ${B}/nvidia-container-setup.service
|
||||||
-e's,!SYSCONFDIR!,${sysconfdir},g' \
|
|
||||||
-e's,!DATADIR!,${datadir},g' ${UNPACKDIR}/config.toml.in > ${B}/config.toml
|
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install(){
|
do_install(){
|
||||||
go_do_install
|
go_do_install
|
||||||
install -m 0644 -D -t ${D}${sysconfdir}/nvidia-container-runtime ${B}/config.toml
|
|
||||||
ln -sf nvidia-container-runtime-hook ${D}${bindir}/nvidia-container-toolkit
|
ln -sf nvidia-container-runtime-hook ${D}${bindir}/nvidia-container-toolkit
|
||||||
|
install -d ${D}${sysconfdir}/nvidia-container-runtime
|
||||||
|
install -D -m0755 ${B}/generate-config.sh ${D}${libexecdir}/nvidia-container-runtime/generate-config
|
||||||
|
install -D -m0644 ${B}/nvidia-container-setup.service ${D}${systemd_system_unitdir}/nvidia-container-setup.service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SYSTEMD_SERVICE:${PN} = "nvidia-container-setup.service"
|
||||||
RDEPENDS:${PN} = "\
|
RDEPENDS:${PN} = "\
|
||||||
libnvidia-container-tools \
|
libnvidia-container-tools \
|
||||||
docker \
|
docker \
|
||||||
|
nv-tegra-release \
|
||||||
tegra-configs-container-csv \
|
tegra-configs-container-csv \
|
||||||
|
tegra-libraries-nvml \
|
||||||
|
tegra-container-passthrough \
|
||||||
"
|
"
|
||||||
RDEPENDS:${PN}-dev += "bash make"
|
RDEPENDS:${PN}-dev += "bash make"
|
||||||
PACKAGE_ARCH:tegra = "${TEGRA_PKGARCH}"
|
PACKAGE_ARCH:tegra = "${TEGRA_PKGARCH}"
|
||||||
Reference in New Issue
Block a user