app-emulation/nvidia-container-toolkit: new package

NVIDIA container runtime toolkit
Replacement of nvidia-docker and nvidia-docker2
nvidia-docker is deprecated because docker now has
native gpu support, which this package is required to use.

Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
Huang Rui
2020-06-13 01:31:44 +08:00
parent 6ea051893e
commit e5dbdf8d5a
4 changed files with 98 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST nvidia-container-toolkit-1.1.1.tar.gz 1768013 BLAKE2B c7fb99d5da981937bcdb00927b9debf8724bbeb54a3e50d043560c424ade5575b9d62d40988e3804f9dfe78650d9d2b186d0469aa0d8a85f561124da28b752a0 SHA512 99db21a0741b8cb36c55cfb1c74dd275013cfaed51bf35eb5546d335ead22b682547835b5c74c57c8a359f0f7869e9ed7b64c17ce4afcc3540fd0b2da0f547e7

View File

@@ -0,0 +1,17 @@
disable-require = false
#swarm-resource = "DOCKER_RESOURCE_GPU"
[nvidia-container-cli]
#root = "/run/nvidia/driver"
#path = "/usr/bin/nvidia-container-cli"
environment = []
#debug = "/var/log/nvidia-container-toolkit.log"
#ldcache = "/etc/ld.so.cache"
load-kmods = true
#no-cgroups = false
user = "root:video"
ldconfig = "@/sbin/ldconfig"
#alpha-merge-visible-devices-envvars = false
[nvidia-container-runtime]
#debug = "/var/log/nvidia-container-runtime.log"

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>vowstar@gmail.com</email>
<name>Huang Rui</name>
</maintainer>
<upstream>
<remote-id type="github">NVIDIA/container-toolkit</remote-id>
</upstream>
<longdescription lang="en">
NVIDIA container runtime toolkit, build and run containers leveraging
NVIDIA GPUs. tl;dr: nvidia-docker is deprecated because docker now has
native gpu support, which this package is required to use. The NVIDIA
Container Toolkit (formerly known as NVIDIA Docker) allows containers to
access full GPU acceleration. OpenGL, OpenCL and CUDA are supported for
production use. Vulkan support is currently in beta. This only works for
Linux containers running on Linux host systems with NVIDIA GPUs.
</longdescription>
</pkgmetadata>

View File

@@ -0,0 +1,60 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
GITHUB_PN="container-toolkit"
EGO_PN_VCS="github.com/NVIDIA/${GITHUB_PN}"
EGO_PN="${EGO_PN_VCS}"
inherit golang-build
DESCRIPTION="NVIDIA container runtime toolkit"
HOMEPAGE="https://github.com/NVIDIA/container-toolkit"
if [[ "${PV}" == "9999" ]] ; then
inherit golang-vcs
else
inherit golang-vcs-snapshot
SRC_URI="
https://github.com/NVIDIA/${GITHUB_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
"
KEYWORDS="~amd64"
fi
LICENSE="Apache-2.0"
SLOT="0"
IUSE=""
RDEPEND="
app-emulation/libnvidia-container
"
DEPEND="${RDEPEND}"
BDEPEND=""
src_compile() {
echo "${S}" || die
EGO_PN="${EGO_PN_VCS}/pkg" \
EGO_BUILD_FLAGS="-o ${T}/${PN}" \
golang-build_src_compile
}
src_install() {
dobin "${T}/${PN}"
into "/usr/bin"
dosym "${PN}" "/usr/bin/nvidia-container-runtime-hook"
insinto "/etc/nvidia-container-runtime"
doins "${FILESDIR}/config.toml"
}
pkg_postinst() {
elog "Your docker service must restart after install this package."
elog "OpenRC: sudo rc-service docker restart"
elog "systemd: sudo systemctl restart docker"
elog "You may need to edit your /etc/nvidia-container-runtime/config.toml"
elog "file before running ${PN} for the first time."
elog "For details, please see the NVIDIA docker manual page."
}