What is the difference between this two projects?
Can I use this for Singularity containers?
nvidia-container-runtime is a modified runc with a prestart hook that calls into libnvidia-container. But it is not specific to docker, it can work anywhere an OCI runtime is expected.
The nvidia-docker2 package is tiny, it simply registers this runtime to the docker daemon by adding an entry in /etc/docker/daemon.json.
For Singularity, they now have an integration with libnvidia-container, so you can skip the nvidia-container-runtime and nvidia-docker2 packages altogether.
Most helpful comment
nvidia-container-runtimeis a modifiedruncwith a prestart hook that calls intolibnvidia-container. But it is not specific to docker, it can work anywhere an OCI runtime is expected.The
nvidia-docker2package is tiny, it simply registers this runtime to the docker daemon by adding an entry in/etc/docker/daemon.json.For Singularity, they now have an integration with
libnvidia-container, so you can skip thenvidia-container-runtimeandnvidia-docker2packages altogether.