NVIDIA/libnvidia-container
소개
NVIDIA 컨테이너 런타임 라이브러리
시스템 및 인프라측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +2
- in 1 month
- +5
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originallibnvidia-container
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
Configure the package repository for your Linux distribution.
Install the packages:
libnvidia-container1
libnvidia-container-tools
From sources
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/ directory
make docker
The resulting images have the name nvidia/libnvidia-container/<os>:<version>
Without Docker:
make install
# Alternatively in order to customize the installation paths
DESTDIR=/path/to/root make install prefix=/usr
Using the library
Container runtime example
Refer to the nvidia-container-runtime project.
Command line example
# Setup a new set of namespaces
cd $(mktemp -d) && mkdir rootfs
sudo unshare --mount --pid --fork
# Setup a rootfs based on Ubuntu 16.04 inside the new namespaces
curl http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04.6-base-amd64.tar.gz | tar -C rootfs -xz
useradd -R $(realpath rootfs) -U -u 1000 -s /bin/bash nvidia
mount --bind rootfs rootfs
mount --make-private rootfs
cd rootfs
# Mount standard filesystems
mount -t proc none proc
mount -t sysfs none sys
mount -t tmpfs none tmp
mount -t tmpfs none run
# Isolate the first GPU device along with basic utilities
nvidia-container-cli --load-kmods configure --ldconfig=@/sbin/ldconfig.real --no-cgroups --utility --device 0 $(pwd)
# Change into the new rootfs
pivot_root . mnt
umount -l mnt
exec chroot --userspec 1000:1000 . env -i bash
# Run nvidia-smi from within the container
nvidia-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
Checkout the Contributing document!
- Please let us know by filing a new issue
- Contributions must adhere to the Code of Conduct.
Support and Getting Help
You can join our community Slack. Your feedback is appreciated.
관련 프로젝트 살펴보기
불러오는 중…