Documentation ¶
Index ¶
- func NVCLIConfigure(nvidiaEnv []string, rootfs string, userNS bool) error
- func NVCLIEnvToFlags(nvidiaEnv []string) (flags []string, err error)
- func NvidiaDevices(withGPU bool) ([]string, error)
- func NvidiaIpcsPath() ([]string, error)
- func NvidiaPaths(configFilePath string) ([]string, []string, error)
- func RocmDevices() ([]string, error)
- func RocmPaths(configFilePath string) ([]string, []string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NVCLIConfigure ¶
NVCLIConfigure calls out to the nvidia-container-cli configure operation. This sets up the GPU with the container. Note that the ability to set a fairly broad range of ambient capabilities is required. This function will error if the bounding set does not include NvidiaContainerCLIAmbientCaps.
When userNS is true, we are running in a user namespace and don't require any privilege escalation when calling out to `nvidia-container-cli`.
When userNS is false, we are not running in a user namespace, but are in setuid mode or directly called as `sudo apptainer` etc. In this case we exec `nvidia-container-cli` as root via SysProcAttr, having first ensured that it and `ldconfig` are root-owned.
func NVCLIEnvToFlags ¶
NVCLIEnvToFlags reads the passed in NVIDIA_ environment variables supported by nvidia-container-runtime and converts them to flags for nvidia-container-cli. See: https://github.com/nvidia/nvidia-container-runtime#environment-variables-oci-spec
func NvidiaDevices ¶
NvidiaDevices return list of all non-GPU nvidia devices present on host. If withGPU is true all GPUs are included in the resulting list as well.
func NvidiaIpcsPath ¶
NvidiaIpcsPath returns a list of nvidia driver ipcs. Currently this is only the persistenced socket (if found).
func NvidiaPaths ¶
NvidiaPaths returns a list of Nvidia libraries/binaries that should be mounted into the container in order to use Nvidia GPUs
func RocmDevices ¶
RocmDevices returns a list of /dev entries required for ROCm functionality.
Types ¶
This section is empty.