NVIDIA/libnvidia-container

Name: libnvidia-container

Owner: NVIDIA Corporation

Description: NVIDIA container runtime library

Created: 2017-04-14 23:45:54.0

Updated: 2018-04-02 15:28:17.0

Pushed: 2018-03-29 17:31:43.0

Homepage: null

Size: 5604

Language: C

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

libnvidia-container

GitHub license GitHub release Package repository Travis Coverity Scan

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.

Installing the library
From packages

Refer to the repository configuration for your Linux distribution.

From sources

With Docker:

nerate packages for a given distribution in the dist/ directory
 docker-ubuntu:16.04 TAG=rc.1

Without Docker:

 install

ternatively in order to customize the installation paths
DIR=/path/to/root make install prefix=/usr
Using the library
Container runtime example

Refer to the nvidia-container-runtime project.

Command line example
tup a rootfs based on Ubuntu 16.04 inside new namespaces
(mktemp -d) && mkdir rootfs
 unshare --mount --pid --fork
 http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04-core-amd64.tar.gz | tar -C rootfs -xz
add -R $(realpath rootfs) -U -u 1000 -s /bin/bash nvidia
t --bind rootfs rootfs
t --make-private rootfs
ootfs

unt standard filesystems
t -t proc none proc
t -t sysfs none sys
t -t tmpfs none tmp
t -t tmpfs none run

olate the first GPU device along with basic utilities
ia-container-cli --load-kmods configure --no-cgroups --utility --device 0 .

ange into the new rootfs
t_root . mnt
nt -l mnt
 chroot --userspec 1000:1000 . env -i bash

n nvidia-smi from within the container
ia-smi -L
Copyright and License

This project is released under the BSD 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 to NOTICE for more information.

Issues and Contributing

A signed copy of the Contributor License Agreement needs to be provided to digits@nvidia.com before any change can be accepted.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.