# nvidia-container-runtime **Repository Path**: mirrors_hustcat/nvidia-container-runtime ## Basic Information - **Project Name**: nvidia-container-runtime - **Description**: NVIDIA container runtime - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2025-09-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # nvidia-container-runtime [![GitHub license](https://img.shields.io/badge/license-New%20BSD-blue.svg?style=flat-square)](https://raw.githubusercontent.com/NVIDIA/nvidia-container-runtime/master/LICENSE) [![Package repository](https://img.shields.io/badge/packages-repository-b956e8.svg?style=flat-square)](https://nvidia.github.io/nvidia-container-runtime) A modified version of [runc](https://github.com/opencontainers/runc) adding a custom [pre-start hook](https://github.com/opencontainers/runtime-spec/blob/master/config.md#prestart) to all containers. If environment variable `NVIDIA_VISIBLE_DEVICES` is set in the OCI spec, the hook will configure GPU access for the container by leveraging `nvidia-container-cli` from project [libnvidia-container](https://github.com/NVIDIA/libnvidia-container). ## Usage example ```sh # Setup a rootfs based on Ubuntu 16.04 cd $(mktemp -d) && mkdir rootfs curl -sS http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04-core-amd64.tar.gz | tar --exclude 'dev/*' -C rootfs -xz # Create an OCI runtime spec nvidia-container-runtime spec sed -i 's;"sh";"nvidia-smi";' config.json sed -i 's;\("TERM=xterm"\);\1, "NVIDIA_VISIBLE_DEVICES=0";' config.json # Run the container sudo nvidia-container-runtime run nvidia_smi ``` ## Installation #### Ubuntu distributions 1. Install the repository for your distribution by following the instructions [here](http://nvidia.github.io/nvidia-container-runtime/). 2. Install the `nvidia-container-runtime` package: ``` sudo apt-get install nvidia-container-runtime ``` #### CentOS distributions 1. Install the repository for your distribution by following the instructions [here](http://nvidia.github.io/nvidia-container-runtime/). 2. Install the `nvidia-container-runtime` package: ``` sudo yum install nvidia-container-runtime ``` ## Docker Engine setup **Do not follow this section if you installed the `nvidia-docker2` package, it already registers the runtime.** To register the `nvidia` runtime, use the method below that is best suited to your environment. You might need to merge the new argument with your existing configuration. #### Systemd drop-in file ```bash sudo mkdir -p /etc/systemd/system/docker.service.d sudo tee /etc/systemd/system/docker.service.d/override.conf <=7.5`, `cuda>=8.0`, `cuda>=9.0` …: any valid CUDA version in the form `major.minor`. ### `CUDA_VERSION` Similar to `NVIDIA_REQUIRE_CUDA`, for legacy CUDA images. In addition, if `NVIDIA_REQUIRE_CUDA` is not set, `NVIDIA_VISIBLE_DEVICES` and `NVIDIA_DRIVER_CAPABILITIES` will default to `all`. ## Copyright and License This project is released under the [BSD 3-clause license](https://github.com/NVIDIA/nvidia-container-runtime/blob/master/LICENSE).