Documentation ¶
Overview ¶
Package gpuconfig implements routines for manipulating proto based GPU build configuration files.
It also implements the construction of these configs for the COS Image and the COS Kernel CI.
Package gpuconfig implements routines for manipulating proto based GPU build configuration files.
It also implements the construction of these configs for the COS Image and the COS Kernel CI.
Index ¶
- func GetGPUDriverVersion(gpuProtoContent []byte, gpuType string, input string, fallback bool) (string, error)
- func GetGPUDriverVersions(gpuProtoContent []byte, gpuType string) ([]*pb.DriverVersion, error)
- func UploadConfigs(ctx context.Context, client *storage.Client, configs []GPUPrecompilationConfig, ...) error
- type GPUArtifactsDownloader
- func (d *GPUArtifactsDownloader) ArtifactExists(ctx context.Context, artifactPath string) (bool, error)
- func (d *GPUArtifactsDownloader) DownloadArtifact(ctx context.Context, destDir, artifactPath string) error
- func (d *GPUArtifactsDownloader) DownloadGenericNvidiaDriver(ctx context.Context, destDir, driverVersion string) (string, error)
- func (d *GPUArtifactsDownloader) DownloadKernelHeaders(ctx context.Context, destDir string) error
- func (d *GPUArtifactsDownloader) DownloadKernelSrc(ctx context.Context, destDir string) error
- func (d *GPUArtifactsDownloader) DownloadNVIDIARunfile(ctx context.Context, destDir string) (string, error)
- func (d *GPUArtifactsDownloader) DownloadToolchain(ctx context.Context, destDir string) error
- func (d *GPUArtifactsDownloader) DownloadToolchainEnv(ctx context.Context, destDir string) error
- func (d *GPUArtifactsDownloader) GetArtifact(ctx context.Context, artifact string) ([]byte, error)
- func (d *GPUArtifactsDownloader) ListArtifacts(ctx context.Context, prefix string) ([]string, error)
- type GPUPrecompilationConfig
- func GenerateKernelCIConfigs(ctx context.Context, client *storage.Client, kernelVersion string, ...) ([]GPUPrecompilationConfig, error)
- func ReadConfig(ctx context.Context, client *storage.Client, dirName string) (GPUPrecompilationConfig, error)
- func ReadConfigs(ctx context.Context, client *storage.Client, bucketName string, ...) ([]GPUPrecompilationConfig, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGPUDriverVersion ¶
func GetGPUDriverVersion(gpuProtoContent []byte, gpuType string, input string, fallback bool) (string, error)
GetGPUDriverVersion fetch the GPU driver version from the input given the specific gpuType, fallback flag and proto bytes. The input here can be:
- Precise GPU driver versions, e.g. 535.125.67, 560.38 In this case, we will check whether this version is compatible with gpuType.
- Major GPU version label, e.g. R535, or default or latest or empty label. In this case, we will find out the driver version which is associated to this label for gpuType.
func GetGPUDriverVersions ¶
func GetGPUDriverVersions(gpuProtoContent []byte, gpuType string) ([]*pb.DriverVersion, error)
GetGPUDriverVersions will fetch a list of GPU driver versions that support the gpuType.
func UploadConfigs ¶
Types ¶
type GPUArtifactsDownloader ¶
type GPUArtifactsDownloader struct {
// contains filtered or unexported fields
}
func NewGPUArtifactsDownloader ¶
func NewGPUArtifactsDownloader(client *storage.Client, config GPUPrecompilationConfig) *GPUArtifactsDownloader
NewGPUArtifactsDownloader creates a GPUArtifactsDownloader instance.
func (*GPUArtifactsDownloader) ArtifactExists ¶
func (*GPUArtifactsDownloader) DownloadArtifact ¶
func (d *GPUArtifactsDownloader) DownloadArtifact(ctx context.Context, destDir, artifactPath string) error
DownloadArtifact downloads an artifact from the GCS prefix configured in GPUArtifactsDownloader.
func (*GPUArtifactsDownloader) DownloadGenericNvidiaDriver ¶
func (*GPUArtifactsDownloader) DownloadKernelHeaders ¶
func (d *GPUArtifactsDownloader) DownloadKernelHeaders(ctx context.Context, destDir string) error
DownloadKernelHeaders downloads COS kernel headers to destination directory.
func (*GPUArtifactsDownloader) DownloadKernelSrc ¶
func (d *GPUArtifactsDownloader) DownloadKernelSrc(ctx context.Context, destDir string) error
DownloadKernelSrc downloads COS kernel sources to destination directory.
func (*GPUArtifactsDownloader) DownloadNVIDIARunfile ¶
func (*GPUArtifactsDownloader) DownloadToolchain ¶
func (d *GPUArtifactsDownloader) DownloadToolchain(ctx context.Context, destDir string) error
DownloadToolchain downloads toolchain package to destination directory.
func (*GPUArtifactsDownloader) DownloadToolchainEnv ¶
func (d *GPUArtifactsDownloader) DownloadToolchainEnv(ctx context.Context, destDir string) error
DownloadToolchainEnv downloads toolchain compilation environment variables to destination directory.
func (*GPUArtifactsDownloader) GetArtifact ¶
func (*GPUArtifactsDownloader) ListArtifacts ¶
type GPUPrecompilationConfig ¶
type GPUPrecompilationConfig struct { ProtoConfig *pb.COSGPUBuildRequest `json:"-"` DriverVersion string `json:"driver_version"` Milestone string `json:"milestone"` Version string `json:"version"` VersionType string `json:"version_type"` }
func GenerateKernelCIConfigs ¶
func GenerateKernelCIConfigs(ctx context.Context, client *storage.Client, kernelVersion string, driverVersions []string) ([]GPUPrecompilationConfig, error)
Generates and GPU precompilation build configs(and metadata) for a given tuple of kernelVersion and driver versions
func ReadConfig ¶
func ReadConfig(ctx context.Context, client *storage.Client, dirName string) (GPUPrecompilationConfig, error)
Reads precompilation config from GCS bucket into GPUPrecompilationConfig struct.