Documentation
¶
Overview ¶
Package installer provides functionality to install GPU drivers.
Index ¶
- Constants
- Variables
- func ConfigureCachedInstallation(gpuInstallDirHost, kernelDriversPath string, ...) error
- func ConfigureDriverInstallationDirs(gpuInstallDirHost, kernelRelease, arch string) (func(), error)
- func DownloadDriverInstallerV2(ctx context.Context, downloader cos.ExtensionsDownloader, driverVersion string) (string, error)
- func DownloadGPUDriverVersionArtifacts(ctx context.Context, downloader cos.ArtifactsDownloader) (map[string]string, error)
- func DownloadGPUDriverVersionsProto(ctx context.Context, downloader cos.ArtifactsDownloader, gpuInstallDir string) ([]byte, error)
- func DownloadGenericDriverInstaller(ctx context.Context, downloader *cos.GCSDownloader, driverVersion string) (string, error)
- func DownloadImexDriver(ctx context.Context, downloader *cos.GCSDownloader, driverVersion string) (string, error)
- func DownloadToInstallDir(url, infoStr string) (string, error)
- func GetGPUDriverVersion(ctx context.Context, downloader cos.ArtifactsDownloader, alias string) (string, error)
- func GetLoadedNVIDIAKernelModuleVersion(versionFilePath string) string
- func InstallGDRCopy(noVerify bool, moduleParams modules.ModuleParameters) error
- func InstallImexDriver(imexArtifactPath string, driverVersion string, installDirHost string, ...) error
- func InstallImexDriverDefault(imexArtifactPath string, driverVersion string, installDirHost string) error
- func PrebuiltModulesAvailable(ctx context.Context, downloader *cos.GCSDownloader, driverVersion string, ...) (bool, error)
- func RunDriverInstaller(toolchainDir, installerFilename, driverVersion, arch, kernelDriversPath string, ...) error
- func RunDriverInstallerPrebuiltModules(ctx context.Context, downloader *cos.GCSDownloader, ...) error
- func VerifyDriverInstallation(noVerify, debug, skipNvidiaSmi bool) error
- type Cacher
Constants ¶
const ( DefaultVersion = "default" LatestVersion = "latest" MajorGPUDriverArtifactPrefix = "gpu_" MajorGPUDriverArtifactSuffix = "_version" )
Variables ¶
var ( // ErrDriverLoad indicates that installed GPU drivers could not be loaded into // the kernel. ErrDriverLoad = stderrors.New("failed to load GPU drivers") )
Functions ¶
func ConfigureCachedInstallation ¶
func ConfigureCachedInstallation(gpuInstallDirHost, kernelDriversPath string, needSigned, test, kernelOpen, noVerify bool, moduleParameters modules.ModuleParameters) error
ConfigureCachedInstallation updates ldconfig and installs the cached GPU driver kernel modules.
func ConfigureDriverInstallationDirs ¶
ConfigureDriverInstallationDirs configures GPU driver installation directories by creating mounts.
func DownloadDriverInstallerV2 ¶
func DownloadDriverInstallerV2(ctx context.Context, downloader cos.ExtensionsDownloader, driverVersion string) (string, error)
DownloadDriverInstallerV2 downloads GPU driver installer given driver version from COS build artifacts.
func DownloadGPUDriverVersionArtifacts ¶
func DownloadGPUDriverVersionArtifacts(ctx context.Context, downloader cos.ArtifactsDownloader) (map[string]string, error)
DownloadGPUDriverVersionArtifacts fetch all the gpu_xx_version files and the key is the file name and the value is the content. E.g. gpu_default_version -> 535.129.03, gpu_R470_version -> 470.223.02, gpu_R535_version -> 535.129.03,
func DownloadGPUDriverVersionsProto ¶
func DownloadGPUDriverVersionsProto(ctx context.Context, downloader cos.ArtifactsDownloader, gpuInstallDir string) ([]byte, error)
DownloadGPUDriverVersionsProto will download gpuDriverProtoBin from GCS bucket to /var/lib/nvidia if it does not exist.
func DownloadGenericDriverInstaller ¶
func DownloadGenericDriverInstaller(ctx context.Context, downloader *cos.GCSDownloader, driverVersion string) (string, error)
DownloadGenericDriverInstaller downloads the generic GPU driver installer given driver version.
func DownloadImexDriver ¶
func DownloadImexDriver(ctx context.Context, downloader *cos.GCSDownloader, driverVersion string) (string, error)
DownloadImexDriver downloads the IMEX driver using the GCSDownloader.
func DownloadToInstallDir ¶
DownloadToInstallDir downloads data from the provided URL to the GPU installation directory. It returns the basename of the locally written file.
func GetGPUDriverVersion ¶
func GetGPUDriverVersion(ctx context.Context, downloader cos.ArtifactsDownloader, alias string) (string, error)
GeGGPUDriverVersion gets the supplied GPU driver version. Supports "default", "latest", "R470", "R525" aliases
func InstallGDRCopy ¶
func InstallGDRCopy(noVerify bool, moduleParams modules.ModuleParameters) error
InstallGDRCopy loads the GDRCopy kernel module and creates its device node. This should be run after the main NVIDIA kernel modules are loaded. It follows https://github.com/NVIDIA/gdrcopy/blob/master/insmod.sh.
func InstallImexDriver ¶
func InstallImexDriver(imexArtifactPath string, driverVersion string, installDirHost string, installDirContainer string) error
InstallImexDriver installs IMEX driver binaries from a given tarball into the specified installDirContainer. It performs the following steps: 1. Extracts the IMEX driver tarball (imexArtifactPath) to a temporary working directory. 2. Installs the IMEX binaries ("nvidia-imex", "nvidia-imex-ctl") into <installDirContainer>/bin with default permissions(0755). 3. Copies the original config.cfg from the <temp-working-dir>/etc/nvidia-imex/config.cfg and installs it into <installDirContainer>/imex-config/config.cfg 4. Patches the copied config.cfg so that the default IMEX_NODE_CONFIG_FILE points to the default nodes_config.cfg to the `<installDirHost>/imex-config/config.cfg` with 0644 permission. 5. Create an empty nodes_config.cfg file at <installDirContainer>/imex-config/nodes_config.cfg This function is testable and allows overriding the install directory path.
func InstallImexDriverDefault ¶
func InstallImexDriverDefault(imexArtifactPath string, driverVersion string, installDirHost string) error
InstallImexDriverDefault installs IMEX driver binaries to the default container location (const: gpuInstallDirContainer) This is a wrapper around InstallImexDriver for production usage, using the default constant gpuInstallDirContainer as the target install path.
func RunDriverInstaller ¶
func RunDriverInstaller(toolchainDir, installerFilename, driverVersion, arch, kernelDriversPath string, needSigned, test, legacyLink, noVerify bool, moduleParameters modules.ModuleParameters) error
RunDriverInstaller runs GPU driver installer. Only works if the provided installer includes precompiled drivers.
func RunDriverInstallerPrebuiltModules ¶
func RunDriverInstallerPrebuiltModules(ctx context.Context, downloader *cos.GCSDownloader, installerFilename, driverVersion, arch, kernelDriversPath string, noVerify bool, moduleParameters modules.ModuleParameters) error
func VerifyDriverInstallation ¶
VerifyDriverInstallation runs some commands to verify the driver installation.