MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / getDriverInfo

Function getDriverInfo

cmd/nvidia-validator/driver.go:41–73  ·  view source on GitHub ↗
(isHostDriver bool, hostRoot string, driverInstallDir string, driverInstallDirCtrPath string)

Source from the content-addressed store, hash-verified

39}
40
41func getDriverInfo(isHostDriver bool, hostRoot string, driverInstallDir string, driverInstallDirCtrPath string) driverInfo {
42 if isHostDriver {
43 return driverInfo{
44 isHostDriver: true,
45 hostRoot: hostRoot,
46 driverRoot: hostRoot,
47 driverRootCtrPath: "/host",
48 devRoot: hostRoot,
49 devRootCtrPath: "/host",
50 }
51 }
52
53 // For drivers not installed directly on the host, devRoot can either be
54 // hostRoot or driverInstallDir
55 var devRoot, devRootCtrPath string
56 devRoot = root(driverInstallDirCtrPath).getDevRoot()
57 if devRoot == "/" {
58 devRoot = hostRoot
59 devRootCtrPath = "/host"
60 } else {
61 devRoot = driverInstallDir
62 devRootCtrPath = "/driver-root"
63 }
64
65 return driverInfo{
66 isHostDriver: false,
67 hostRoot: hostRoot,
68 driverRoot: driverInstallDir,
69 driverRootCtrPath: "/driver-root",
70 devRoot: devRoot,
71 devRootCtrPath: devRootCtrPath,
72 }
73}

Callers 1

runValidationMethod · 0.85

Calls 2

rootTypeAlias · 0.85
getDevRootMethod · 0.80

Tested by

no test coverage detected