gpu

package
v1.3.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NVCLIConfigure

func NVCLIConfigure(nvidiaEnv []string, rootfs string, userNS bool) error

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

func NVCLIEnvToFlags(nvidiaEnv []string) (flags []string, err error)

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

func NvidiaDevices(withGPU bool) ([]string, error)

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

func NvidiaIpcsPath() ([]string, error)

NvidiaIpcsPath returns a list of nvidia driver ipcs. Currently this is only the persistenced socket (if found).

func NvidiaPaths

func NvidiaPaths(configFilePath string) ([]string, []string, error)

NvidiaPaths returns a list of Nvidia libraries/binaries that should be mounted into the container in order to use Nvidia GPUs

func RocmDevices

func RocmDevices() ([]string, error)

RocmDevices returns a list of /dev entries required for ROCm functionality.

func RocmPaths

func RocmPaths(configFilePath string) ([]string, []string, error)

RocmPaths returns a list of rocm libraries/binaries that should be mounted into the container in order to use AMD GPUs

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL