installer

package
v0.0.0-...-b3b9084 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package installer provides functionality to install GPU drivers.

Index

Constants

View Source
const (
	DefaultVersion               = "default"
	LatestVersion                = "latest"
	MajorGPUDriverArtifactPrefix = "gpu_"
	MajorGPUDriverArtifactSuffix = "_version"
)

Variables

View Source
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

func ConfigureDriverInstallationDirs(gpuInstallDirHost, kernelRelease, arch string) (func(), error)

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 DownloadToInstallDir

func DownloadToInstallDir(url, infoStr string) (string, error)

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 GetLoadedNVIDIAKernelModuleVersion

func GetLoadedNVIDIAKernelModuleVersion(versionFilePath string) string

func PrebuiltModulesAvailable

func PrebuiltModulesAvailable(ctx context.Context, downloader *cos.GCSDownloader, driverVersion string, kernelOpen bool) (bool, error)

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

func VerifyDriverInstallation(noVerify, debug bool) error

VerifyDriverInstallation runs some commands to verify the driver installation.

Types

type Cacher

type Cacher struct {
	// contains filtered or unexported fields
}

Cacher is to cache GPU driver installation info.

func NewCacher

func NewCacher(gpuInstallDir, buildNumber, driverVersion string) *Cacher

NewCacher returns an instance of Cacher.

func (*Cacher) Cache

func (c *Cacher) Cache(kernelOpen bool) error

Cache writes to fs about the information that a given GPU driver has been installed.

func (*Cacher) IsCached

func (c *Cacher) IsCached() (bool, bool, error)

IsCached returns a bool pair indicating whether a given GPU driver has been installed and if the installation contains open source kernel modules

Jump to

Keyboard shortcuts

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