- Notifications
You must be signed in to change notification settings - Fork249
NVIDIA container runtime library
License
Apache-2.0 and 2 other licenses found
Licenses found
NVIDIA/libnvidia-container
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repository provides a library and a simple CLI utility to automatically configure GNU/Linux containers leveraging NVIDIA hardware.
The implementation relies on kernel primitives and is designed to be agnostic of the container runtime.
Configure thepackage repository for your Linux distribution.
Install the packages:
libnvidia-container1libnvidia-container-tools
With Docker:
# Generate docker images for a supported <os><version>make {ubuntu18.04, ubuntu16.04, debian10, debian9, centos7, amazonlinux2, opensuse-leap15.1}# Or generate docker images for all supported distributions in the dist/ directorymake docker
The resulting images have the namenvidia/libnvidia-container/<os>:<version>
Without Docker:
make install# Alternatively in order to customize the installation pathsDESTDIR=/path/to/root make install prefix=/usrRefer to thenvidia-container-runtime project.
# Setup a new set of namespacescd$(mktemp -d)&& mkdir rootfssudo unshare --mount --pid --fork# Setup a rootfs based on Ubuntu 16.04 inside the new namespacescurl http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04.6-base-amd64.tar.gz| tar -C rootfs -xzuseradd -R$(realpath rootfs) -U -u 1000 -s /bin/bash nvidiamount --bind rootfs rootfsmount --make-private rootfscd rootfs# Mount standard filesystemsmount -t proc none procmount -t sysfs none sysmount -t tmpfs none tmpmount -t tmpfs none run# Isolate the first GPU device along with basic utilitiesnvidia-container-cli --load-kmods configure --ldconfig=@/sbin/ldconfig.real --no-cgroups --utility --device 0$(pwd)# Change into the new rootfspivot_root. mntumount -l mntexec chroot --userspec 1000:1000. env -i bash# Run nvidia-smi from within the containernvidia-smi -L
This project is released under theBSD 3-clause license.
Additionally, this project can be dynamically linked with libelf from the elfutils package (https://sourceware.org/elfutils), in which case additional terms apply.
Refer toNOTICE for more information.
Checkout the Contributing document!
- Please let us know byfiling a new issue
- You can contribute by opening apull request
About
NVIDIA container runtime library
Resources
License
Apache-2.0 and 2 other licenses found
Licenses found
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.