From d17aa6f4960e1d386abadf2288403efa4c1753ab Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Fri, 16 Jul 2021 05:26:41 -0600 Subject: [PATCH] chore: Package for Pop --- .gitattributes | 1 + Makefile | 31 +- debian/changelog | 265 ++++++++++++++++++ debian/control | 62 ++++ debian/copyright | 92 ++++++ debian/libnvidia-container-dev.install | 4 + .../libnvidia-container-dev.lintian-overrides | 1 + debian/libnvidia-container-tools.install | 1 + ...ibnvidia-container-tools.lintian-overrides | 2 + debian/libnvidia-container1-dbg.install | 1 + ...libnvidia-container1-dbg.lintian-overrides | 1 + debian/libnvidia-container1.install | 1 + debian/libnvidia-container1.lintian-overrides | 1 + debian/libnvidia-container1.symbols | 27 ++ debian/prepare | 30 ++ debian/rules | 29 ++ debian/source/format | 1 + mk/common.mk | 6 +- pkg/deb/changelog | 1 + vendor.sh | 10 + 20 files changed, 550 insertions(+), 17 deletions(-) create mode 100644 .gitattributes create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/libnvidia-container-dev.install create mode 100644 debian/libnvidia-container-dev.lintian-overrides create mode 100644 debian/libnvidia-container-tools.install create mode 100644 debian/libnvidia-container-tools.lintian-overrides create mode 100644 debian/libnvidia-container1-dbg.install create mode 100644 debian/libnvidia-container1-dbg.lintian-overrides create mode 100644 debian/libnvidia-container1.install create mode 100644 debian/libnvidia-container1.lintian-overrides create mode 100644 debian/libnvidia-container1.symbols create mode 100755 debian/prepare create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 vendor.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2f86bc3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +deps/src/nvidia-modprobe-450.57/ filter=lfs diff=lfs merge=lfs -text diff --git a/Makefile b/Makefile index 6fb6976..89f9643 100644 --- a/Makefile +++ b/Makefile @@ -18,16 +18,15 @@ ##### Global variables ##### WITH_NVCGO ?= yes -WITH_LIBELF ?= no +WITH_LIBELF ?= yes WITH_TIRPC ?= no WITH_SECCOMP ?= yes ##### Global definitions ##### - -export prefix = /usr/local +export prefix = /usr export exec_prefix = $(prefix) export bindir = $(exec_prefix)/bin -export libdir = $(exec_prefix)/lib +export libdir = $(exec_prefix)/lib/x86_64-linux-gnu export docdir = $(prefix)/share/doc export libdbgdir = $(prefix)/lib/debug$(libdir) export includedir = $(prefix)/include @@ -139,12 +138,12 @@ LIBGO_SYMLINK := $(LIBGO_NAME).so ##### Flags definitions ##### # Common flags -CPPFLAGS := -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 $(CPPFLAGS) +CPPFLAGS := -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -fPIC $(CPPFLAGS) CFLAGS := -std=gnu11 -O2 -g -fdata-sections -ffunction-sections -fplan9-extensions -fstack-protector -fno-strict-aliasing -fvisibility=hidden \ -Wall -Wextra -Wcast-align -Wpointer-arith -Wmissing-prototypes -Wnonnull \ -Wwrite-strings -Wlogical-op -Wformat=2 -Wmissing-format-attribute -Winit-self -Wshadow \ -Wstrict-prototypes -Wunreachable-code -Wconversion -Wsign-conversion \ - -Wno-unknown-warning-option -Wno-format-extra-args -Wno-gnu-alignof-expression $(CFLAGS) + -Wno-unknown-warning-option -Wno-format-extra-args -Wno-gnu-alignof-expression -fPIC $(CFLAGS) LDFLAGS := -Wl,-zrelro -Wl,-znow -Wl,-zdefs -Wl,--gc-sections $(LDFLAGS) LDLIBS := $(LDLIBS) @@ -164,14 +163,15 @@ LIB_LDLIBS_SHARED += -lelf else LIB_LDLIBS_STATIC += -l:libelf.a endif -ifeq ($(WITH_TIRPC), yes) -LIB_CPPFLAGS += -isystem $(DEPS_DIR)$(includedir)/tirpc -DWITH_TIRPC -LIB_LDLIBS_STATIC += -l:libtirpc.a -LIB_LDLIBS_SHARED += -lpthread -endif +# ifeq ($(WITH_TIRPC), yes) +# LIB_CPPFLAGS += -isystem $(DEPS_DIR)$(includedir)/tirpc -DWITH_TIRPC +# LIB_LDLIBS_STATIC += -l:libtirpc.a +# LIB_LDLIBS_SHARED += -lpthread +# endif +CFLAGS += -I/usr/include/tirpc ifeq ($(WITH_SECCOMP), yes) -LIB_CPPFLAGS += -DWITH_SECCOMP $(shell pkg-config --cflags libseccomp) -LIB_LDLIBS_SHARED += $(shell pkg-config --libs libseccomp) +LIB_CPPFLAGS += -DWITH_SECCOMP -DWITH_TIRPC $(shell pkg-config --cflags libseccomp libtirpc) +LIB_LDLIBS_SHARED += $(shell pkg-config --libs libseccomp libtirpc) endif LIB_CPPFLAGS += $(CPPFLAGS) LIB_CFLAGS += $(CFLAGS) @@ -211,7 +211,10 @@ $(BUILD_DEFS): $(LIB_RPC_SRCS): $(LIB_RPC_SPEC) $(RM) $@ - cd $(dir $@) && $(RPCGEN) $(RPCGENFLAGS) -C -M -N -o $(notdir $@) $(LIB_RPC_SPEC) + if cd $(dir $@); then \ + $(RPCGEN) $(RPCGENFLAGS) -C -M -N -o $(notdir $@) $(LIB_RPC_SPEC); \ + sed "s#$(CURDIR)/src/##g" -i "$@"; \ + fi $(LIB_OBJS): %.lo: %.c | deps $(CC) $(LIB_CFLAGS) $(LIB_CPPFLAGS) -MMD -MF $*.d -c $(OUTPUT_OPTION) $< diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..a39a0a4 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,265 @@ +libnvidia-container (1.12.1-0pop1) jammy; urgency=medium + + * Backport + + -- Michael Aaron Murphy Tue, 21 Mar 2023 15:04:07 +0100 + +libnvidia-container (1.11.0-0pop1) jammy; urgency=medium + + * Backport + + -- Michael Aaron Murphy Mon, 19 Sep 2022 01:14:47 +0200 + +libnvidia-container (1.8.0-1) impish; urgency=medium + + * Package for Pop + + -- Michael Aaron Murphy Mon, 07 Feb 2022 17:08:08 +0100 + +libnvidia-container (1.7.0-1) focal; urgency=medium + + * Package for Pop + + -- Michael Aaron Murphy Sun, 02 Jan 2022 17:26:31 +0100 + +libnvidia-container (1.4.0-1pop1) focal; urgency=medium + + * Pop Backport + + -- Michael Aaron Murphy Tue, 03 Aug 2021 20:17:11 +0200 + +libnvidia-container (1.4.0-1) focal; urgency=medium + + [ NVIDIA CORPORATION ] + * Mount all of /proc/.../nvidia/capabilities with --mig-{config, monitor} + * Add fabricmanager as a valid IPC to inject into a container + * Added libnvidia-nscq.so as an optional injected utility lib + * Add Jenkinsfile for internal CI + * Invoke docker make file separately + * WSL - Add full NVML support for WSL in the container library + + -- NVIDIA CORPORATION Sat, 24 Apr 2021 04:34:26 -0700 + +libnvidia-container (1.3.3-1) UNRELEASED; urgency=medium + + * Promote 1.3.3~rc.2 to 1.3.3-1 + + -- NVIDIA CORPORATION Fri, 05 Feb 2021 02:13:49 -0700 + +libnvidia-container (1.3.3~rc.2-1) experimental; urgency=medium + + * Remove path_join() with already chrooted directory + + -- NVIDIA CORPORATION Wed, 03 Feb 2021 13:36:45 -0700 + +libnvidia-container (1.3.3~rc.1-1) experimental; urgency=medium + + * Pre-create MIG related nvcaps at startup + * Add more logging around device node creation with --load-kmods + + -- NVIDIA CORPORATION Wed, 03 Feb 2021 03:34:23 -0700 + +libnvidia-container (1.3.2-1) UNRELEASED; urgency=medium + + * Fix handling of /proc/PID/cgroups entries with colons in paths + * Add pread64 as allowed syscall for ldconfig + + -- NVIDIA CORPORATION Mon, 25 Jan 2021 01:48:49 -0700 + +libnvidia-container (1.3.1-1) UNRELEASED; urgency=medium + + * Honor OPT_NO_CGROUPS in nvc_device_mig_caps_mount + * Fix bug in resolving absolute symlinks in find_library_paths() + + -- NVIDIA CORPORATION Mon, 07 Dec 2020 14:55:38 -0700 + +libnvidia-container (1.3.0-1) UNRELEASED; urgency=medium + + * Promote 1.3.0~rc.1-1 to 1.3.0-1 + + -- NVIDIA CORPORATION Wed, 16 Sep 2020 13:32:02 -0700 + +libnvidia-container (1.3.0~rc.1-1) experimental; urgency=medium + + * 2bda067f Add support to "list" command to print /dev based capabilities + * 3c2ad6aa Add logic to conditionally mount /dev based nvidia-capabilities + * 4d432175 Change default "list" command to set mig-config / mig-monitor = NULL + * 3ec7f3ba Fix minor bug that would not unmount paths on failure + * b5c0a394 Update nvidia-modprobe dependency to 450.57 + + -- NVIDIA CORPORATION Fri, 21 Aug 2020 13:30:28 -0700 + +libnvidia-container (1.2.0-1) UNRELEASED; urgency=medium + + * Promote 1.2.0~rc.3-1 to 1.2.0-1 + + -- NVIDIA CORPORATION Wed, 08 Jul 2020 20:44:10 -0700 + +libnvidia-container (1.2.0~rc.3-1) experimental; urgency=medium + + * 7deea6b8 WSL2 Support - Remove unnecessary umount and free + * 53739009 WSL2 Support - Fix error path when mounting the driver + * 38198a81 WSL2 Support - Fix error path in dxcore + * 31f5ea35 Changed email for travis.ci to kklues@nvidia.com + * abdd5175 Update license and copyright in packages + * 65827fe7 Update license clause to reflect actual licensing + * 77499d88 Transition Travis CI build to Ubuntu 18.04 + + -- NVIDIA CORPORATION Wed, 01 Jul 2020 14:24:59 -0700 + +libnvidia-container (1.2.0~rc.2-1) experimental; urgency=medium + + * 4ea9b59f Update debian based dockerfiles to set distribution in changelog + * a57fcea5 Add 'ngx' as a new capability for a container + * 6f16ccd3 Allow --mig-monitor and --mig-config on machines without MIG capable GPUs + + -- NVIDIA CORPORATION Thu, 18 Jun 2020 21:09:59 -0700 + +libnvidia-container (1.2.0~rc.1-1) experimental; urgency=medium + + * 4263e684 Add support for Windows Subsystem for Linux (WSL2) + * e768f8bc Fix ability to build RC packages via TAG=rc. + + -- NVIDIA CORPORATION Thu, 11 Jun 2020 15:12:59 -0700 + +libnvidia-container (1.1.1-1) UNRELEASED; urgency=medium + + * deeb499 Fixup deb packaging files to remove warnings + * 6003504 nvmlSystemGetCudaDriverVersion_v2 to nvmlSystemGetCudaDriverVersion + * 1ee8b60 Update centos8/rhel8 to conditionally set appropriate CFLAGS and LDLIBS + * d746370 Add smoke test to verify functioning build for all OSs on amd64/x86_64 + + -- NVIDIA CORPORATION Tue, 19 May 2020 12:05:32 -0700 + +libnvidia-container (1.1.0-1) UNRELEASED; urgency=medium + + * b217c6ad Update build system to support multi-arch builds + * 1ddcdfc1 Add support for MIG (Milti-Instance-GPUs) + * ddae363a Add libnvidia-allocator.so as a compute-lib + * 6ed0f129 Add option to not use pivot_root + * e18e9b7a Allow devices to be identified by PCI bus ID + + -- NVIDIA CORPORATION Fri, 15 May 2020 12:05:32 -0700 + +libnvidia-container (1.0.7-1) UNRELEASED; urgency=medium + + * 8d90918a Add Raytracing library + + -- NVIDIA CORPORATION Mon, 11 Nov 2019 13:23:58 -0700 + +libnvidia-container (1.0.6-1) UNRELEASED; urgency=medium + + * b6aff41 Update error messages for CUDA version requirements + + -- NVIDIA CORPORATION Fri, 13 Sep 2019 15:38:16 -0700 + +libnvidia-container (1.0.5-1) UNRELEASED; urgency=medium + + * 688495e Add Opensuse15.1 support + + -- NVIDIA CORPORATION Wed, 04 Sep 2019 10:50:40 -0700 + +libnvidia-container (1.0.4-1) UNRELEASED; urgency=medium + + * 61bfaf38 Update DSL to output the first element instead of the last in case of failure + * 5ce32c6c Add initial support for Optix + * acc38a22 Fix execveat typo + * b5e491b1 arm64: Add support for AARCH64 architecture + + -- NVIDIA CORPORATION Wed, 21 Aug 2019 16:48:40 -0700 + +libnvidia-container (1.0.3-1) UNRELEASED; urgency=medium + + * b9545d7 Add support for Vulkan + + -- NVIDIA CORPORATION Thu, 18 Jul 2019 13:34:30 -0700 + +libnvidia-container (1.0.2-1) UNRELEASED; urgency=medium + + * 4045013 Adds support for libnvidia-opticalflow + + -- NVIDIA CORPORATION Mon, 04 Feb 2019 15:24:12 -0700 + +libnvidia-container (1.0.1-1) UNRELEASED; urgency=medium + + * deccb28 Allow yet more syscalls in ldconfig + + -- NVIDIA CORPORATION Mon, 14 Jan 2019 17:52:52 -0700 + +libnvidia-container (1.0.0-1) UNRELEASED; urgency=medium + + * 35a9f27 Add support for CUDA forward compatibility + * ebed710 Add device brand to the device informations and requirements + * a141a7a Handle 32-bit PCI domains in procfs + * 391c4b6 Preload glibc libraries before switching root + * bcf69c6 Bump libtirpc to 1.1.4 + * 30aec17 Bump nvidia-modprobe-utils to 396.51 + * d05745f Bump the address space limits for ldconfig + + -- NVIDIA CORPORATION Thu, 20 Sep 2018 11:52:52 -0700 + +libnvidia-container (1.0.0~rc.2-1) UNRELEASED; urgency=medium + + * 7ea554a Rework capabilities to support more unprivileged use-cases + * f06cbbb Fix driver process DEATHSIG teardown + * 931bd4f Allow more syscalls in ldconfig + * a0644ea Fix off-by-one error + + -- NVIDIA CORPORATION Mon, 11 Jun 2018 13:39:47 -0700 + +libnvidia-container (1.0.0~rc.1-1) UNRELEASED; urgency=medium + + * 4d43665 Bump nvidia-modprobe-utils to 396.18 + * d8338a6 Bump libtirpc to 1.0.3 + * cef6c8f Add execveat to the list of allowed syscalls + + -- NVIDIA CORPORATION Thu, 26 Apr 2018 15:35:29 -0700 + +libnvidia-container (1.0.0~beta.1-1) UNRELEASED; urgency=medium + + * 6822b13 Bump nvidia-modprobe-utils to 390.25 + * 8245f6c Slightly improve RPC error messages + * 9398d41 Add support for display capability + * 57a0dd5 Increase driver service timeout from 1s to 10s + * e48a0d4 Add device minor to the CLI info command + * 019fdc1 Add support for custom driver root directory + * b78a28c Add ppc64le support + * 41656bf Add --ldcache option to the CLI + + -- NVIDIA CORPORATION Mon, 05 Mar 2018 16:10:35 -0800 + +libnvidia-container (1.0.0~alpha.3-1) UNRELEASED; urgency=medium + + * d268f8f Improve error message if driver installed in the container + * 3fdac29 Add optional support for libelf from the elfutils project + * 584bca5 Remove top directory bind mounts to prevent EXDEV errors + * c6dc820 Add info command to nvidia-container-cli + * 44b74ee Add device model to the device informations + * cbdd58f Strip RPC prefix from error messages + * d4ee216 Rework the CLI list command + * b0c4865 Improve the --userspec CLI option and rename it to --user + * e6fa331 Refactor the CLI and split it into multiple files + * fa9853b Bump nvidia-modprobe-utils to 387.34 + * 7888296 Move the driver capabilities to the container options + * ea2f780 Add support for EGL device isolation + * b5bffa3 Fix driver procfs remount to work with unpatched kernels + + -- NVIDIA CORPORATION Wed, 10 Jan 2018 16:01:11 -0800 + +libnvidia-container (1.0.0~alpha.2-1) UNRELEASED; urgency=medium + + * b80e4b6 Relax some requirement constraints + * 3cd1bb6 Handle 32-bit PCI domains + * 6c67a19 Add support for device architecture requirement + * 7584e96 Filter NVRM proc filesystem based on visible devices + * 93c46e1 Prevent the driver process from triggering MPS + * fe4925e Reject invalid device identifier "GPU-" + * dabef1c Do not change bind mount attributes on top-level directories + + -- NVIDIA CORPORATION Mon, 30 Oct 2017 14:03:39 -0700 + +libnvidia-container (1.0.0~alpha.1-1) UNRELEASED; urgency=medium + + * Initial release + + -- NVIDIA CORPORATION Tue, 05 Sep 2017 14:31:33 -0700 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..a8cb7bd --- /dev/null +++ b/debian/control @@ -0,0 +1,62 @@ +Source: libnvidia-container +Section: libs +Priority: optional +Build-Depends: + bmake, + curl, + debhelper-compat (=10), + golang, + libcap-dev, + libelf-dev, + libseccomp-dev, + libtirpc-dev, + lsb-release, + pkg-config, +Standards-Version: 3.9.6 +Maintainer: NVIDIA CORPORATION +Homepage: https://github.com/NVIDIA/libnvidia-container + +Package: libnvidia-container1 +Architecture: amd64 +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: NVIDIA container runtime library + The nvidia-container library provides an interface to configure GNU/Linux + containers leveraging NVIDIA hardware. The implementation relies on several + kernel subsystems and is designed to be agnostic of the container runtime. + . + This package requires the NVIDIA driver (>= 340.29) to be installed separately. + +Package: libnvidia-container-dev +Architecture: amd64 +Multi-Arch: same +Depends: libnvidia-container1 (= ${binary:Version}), ${misc:Depends} +Description: NVIDIA container runtime library (development files) + The nvidia-container library provides an interface to configure GNU/Linux + containers leveraging NVIDIA hardware. The implementation relies on several + kernel subsystems and is designed to be agnostic of the container runtime. + . + This package contains the files required to compile programs with the library. + +Package: libnvidia-container1-dbg +Architecture: amd64 +Multi-Arch: same +Depends: libnvidia-container1 (= ${binary:Version}), ${misc:Depends} +Description: NVIDIA container runtime library (debugging symbols) + The nvidia-container library provides an interface to configure GNU/Linux + containers leveraging NVIDIA hardware. The implementation relies on several + kernel subsystems and is designed to be agnostic of the container runtime. + . + This package contains the debugging symbols for the library. + +Package: libnvidia-container-tools +Section: utils +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: NVIDIA container runtime library (command-line tools) + The nvidia-container library provides an interface to configure GNU/Linux + containers leveraging NVIDIA hardware. The implementation relies on several + kernel subsystems and is designed to be agnostic of the container runtime. + . + This package contains command-line tools that facilitate using the library. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..4bceec0 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,92 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: libnvidia-container +Source: https://github.com/NVIDIA/libnvidia-container + +Files: * +Copyright: 2017-2020 NVIDIA CORPORATION +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Files: src/elftool.* +Copyright: 2017-2020 NVIDIA CORPORATION +Comment: If these files have been compiled and dynamically linked against libelf from the + elfutils package (usually characterized by the definition of the macro `WITH_LIBELF'), + the following license notice covers the use of said library. +License: LGPL-3+ + elfutils is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + elfutils is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + . + You should have received copies of the GNU General Public License and + the GNU Lesser General Public License along with this program. If + not, see . + . + On Debian systems, the full text of the GNU General Public License and + the GNU Lesser General Public License can be found in the files + `/usr/share/common-licenses/GPL-3' and `/usr/share/common-licenses/LGPL-3'. + +Files: src/elftoolchain.* +Copyright: 2017-2020 NVIDIA CORPORATION +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of NVIDIA CORPORATION nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: src/nvidia-modprobe.* +Copyright: 2017-2020 NVIDIA CORPORATION +License: MIT + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/debian/libnvidia-container-dev.install b/debian/libnvidia-container-dev.install new file mode 100644 index 0000000..7db2737 --- /dev/null +++ b/debian/libnvidia-container-dev.install @@ -0,0 +1,4 @@ +usr/include/*.h +usr/lib/x86_64-linux-gnu/lib*.so +usr/lib/x86_64-linux-gnu/lib*.a +usr/lib/x86_64-linux-gnu/pkgconfig/*.pc diff --git a/debian/libnvidia-container-dev.lintian-overrides b/debian/libnvidia-container-dev.lintian-overrides new file mode 100644 index 0000000..b5de7f6 --- /dev/null +++ b/debian/libnvidia-container-dev.lintian-overrides @@ -0,0 +1 @@ +new-package-should-close-itp-bug diff --git a/debian/libnvidia-container-tools.install b/debian/libnvidia-container-tools.install new file mode 100644 index 0000000..1df36c6 --- /dev/null +++ b/debian/libnvidia-container-tools.install @@ -0,0 +1 @@ +usr/bin/* diff --git a/debian/libnvidia-container-tools.lintian-overrides b/debian/libnvidia-container-tools.lintian-overrides new file mode 100644 index 0000000..52373fb --- /dev/null +++ b/debian/libnvidia-container-tools.lintian-overrides @@ -0,0 +1,2 @@ +new-package-should-close-itp-bug +binary-without-manpage diff --git a/debian/libnvidia-container1-dbg.install b/debian/libnvidia-container1-dbg.install new file mode 100644 index 0000000..18e60d1 --- /dev/null +++ b/debian/libnvidia-container1-dbg.install @@ -0,0 +1 @@ +usr/lib/debug/usr/lib/x86_64-linux-gnu/lib*.so.* diff --git a/debian/libnvidia-container1-dbg.lintian-overrides b/debian/libnvidia-container1-dbg.lintian-overrides new file mode 100644 index 0000000..b5de7f6 --- /dev/null +++ b/debian/libnvidia-container1-dbg.lintian-overrides @@ -0,0 +1 @@ +new-package-should-close-itp-bug diff --git a/debian/libnvidia-container1.install b/debian/libnvidia-container1.install new file mode 100644 index 0000000..8f99241 --- /dev/null +++ b/debian/libnvidia-container1.install @@ -0,0 +1 @@ +usr/lib/x86_64-linux-gnu/lib*.so.* diff --git a/debian/libnvidia-container1.lintian-overrides b/debian/libnvidia-container1.lintian-overrides new file mode 100644 index 0000000..b5de7f6 --- /dev/null +++ b/debian/libnvidia-container1.lintian-overrides @@ -0,0 +1 @@ +new-package-should-close-itp-bug diff --git a/debian/libnvidia-container1.symbols b/debian/libnvidia-container1.symbols new file mode 100644 index 0000000..0381e8e --- /dev/null +++ b/debian/libnvidia-container1.symbols @@ -0,0 +1,27 @@ +libnvidia-container.so.1 libnvidia-container1 #MINVER# + NVC_1.0@NVC_1.0 1.8.0 + nvc_config_free@NVC_1.0 1.8.0 + nvc_config_new@NVC_1.0 1.8.0 + nvc_container_config_free@NVC_1.0 1.8.0 + nvc_container_config_new@NVC_1.0 1.8.0 + nvc_container_free@NVC_1.0 1.8.0 + nvc_container_new@NVC_1.0 1.8.0 + nvc_context_free@NVC_1.0 1.8.0 + nvc_context_new@NVC_1.0 1.8.0 + nvc_device_info_free@NVC_1.0 1.8.0 + nvc_device_info_new@NVC_1.0 1.8.0 + nvc_nvcaps_style@NVC_1.0 1.8.0 + nvc_nvcaps_device_from_proc_path@NVC_1.0 1.8.0 + nvc_device_mount@NVC_1.0 1.8.0 + nvc_mig_device_access_caps_mount@NVC_1.0 1.8.0 + nvc_mig_config_global_caps_mount@NVC_1.0 1.8.0 + nvc_mig_monitor_global_caps_mount@NVC_1.0 1.8.0 + nvc_device_mig_caps_mount@NVC_1.0 1.8.0 + nvc_driver_info_free@NVC_1.0 1.8.0 + nvc_driver_info_new@NVC_1.0 1.8.0 + nvc_driver_mount@NVC_1.0 1.8.0 + nvc_error@NVC_1.0 1.8.0 + nvc_init@NVC_1.0 1.8.0 + nvc_ldcache_update@NVC_1.0 1.8.0 + nvc_shutdown@NVC_1.0 1.8.0 + nvc_version@NVC_1.0 1.8.0 \ No newline at end of file diff --git a/debian/prepare b/debian/prepare new file mode 100755 index 0000000..8436ec2 --- /dev/null +++ b/debian/prepare @@ -0,0 +1,30 @@ +#! /bin/bash + +set -e + +# Replace templated files/contents according to the package version and architecture. +# Also set the package distribution and section area if the environment specifies it. + +VERSION=${1%%[-~+]*} +MAJOR=${1%%.*} + +if [ -z "$VERSION" ] || [ -z "$MAJOR" ] || [ -z "$DEB_HOST_MULTIARCH" ]; then + echo "Error: invalid package version or architecture" + exit 1 +fi + +find . -type d -name '*x86_64-linux-gnu*' | sed "p;s;@DEB_HOST_MULTIARCH@;$DEB_HOST_MULTIARCH;" | \ + xargs -r -n2 sh -c 'rm -rf $1 && mv -T $0 $1' + +find . -type f -name '*1*' | sed "p;s;@MAJOR@;$MAJOR;" | \ + xargs -r -n2 sh -c 'rm -f $1 && mv -T $0 $1' + +grep -rIlE '@(SECTION|VERSION|MAJOR|DEB_HOST_MULTIARCH)@' . | \ + xargs -r sed -i "s;;${SECTION:+$SECTION/}; + s;1.7.0;$VERSION; + s;1;$MAJOR; + s;x86_64-linux-gnu;$DEB_HOST_MULTIARCH;" + +if [ -n "$DISTRIB" ]; then + sed -i "s;UNRELEASED;$DISTRIB;" debian/changelog +fi diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..c3e6782 --- /dev/null +++ b/debian/rules @@ -0,0 +1,29 @@ +#!/usr/bin/make -f +#export DH_VERBOSE = 1 + +export DESTDIR=debian/tmp + +override_dh_auto_clean: + if ! ischroot; then \ + wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz; \ + mkdir -p "$(shell pwd)/go/"; \ + tar -C "$(shell pwd)/" -xzf go1.20.2.linux-amd64.tar.gz; \ + export "PATH=${PATH}:$(shell pwd)/go/bin/"; \ + make clean; \ + env GOCACHE="$(shell pwd)/go/cache" make deps; \ + tar pcf gocache.tar "$(shell pwd)/go"; \ + rm -rf "$(shell pwd)/go/"; \ + fi + +override_dh_auto_build: + tar pxf gocache.tar + env GOCACHE="$(shell pwd)/go/cache" make + +override_dh_auto_install: + env GOCACHE="$(shell pwd)/go/cache" make install + +override_dh_fixperms: + dh_fixperms -X libnvidia-container.so.$(pkgver) + +%: + dh $@ \ No newline at end of file diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/mk/common.mk b/mk/common.mk index f6d5fbf..2dacb09 100644 --- a/mk/common.mk +++ b/mk/common.mk @@ -34,9 +34,9 @@ PLATFORM ?= $(shell uname -m) ifeq ($(DATE),) $(error Invalid date format) endif -ifeq ($(REVISION),) -$(error Invalid commit hash) -endif +# ifeq ($(REVISION),) +# $(error Invalid commit hash) +# endif ifeq ($(COMPILER),) $(error Invalid compiler) endif diff --git a/pkg/deb/changelog b/pkg/deb/changelog index b19ee65..3f49fa2 100644 --- a/pkg/deb/changelog +++ b/pkg/deb/changelog @@ -227,6 +227,7 @@ libnvidia-container (1.5.0~rc.1-1) experimental; urgency=medium libnvidia-container (1.4.0-1) UNRELEASED; urgency=medium + [ NVIDIA CORPORATION ] * Mount all of /proc/.../nvidia/capabilities with --mig-{config, monitor} * Add fabricmanager as a valid IPC to inject into a container * Added libnvidia-nscq.so as an optional injected utility lib diff --git a/vendor.sh b/vendor.sh new file mode 100644 index 0000000..f828fe7 --- /dev/null +++ b/vendor.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +export DEPS_DIR=deps +export MAKE_DIR=mk + +rm -rf deps +make -f mk/nvidia-modprobe.mk deps/src/nvidia-modprobe-495.44/.download_stamp +# make -f mk/elftoolchain.mk deps/src/elftoolchain-0.7.1/.download_stamp \ No newline at end of file