getNvidiaSMIPath returns path to the `nvidia-smi` executable in the driver root.
()
| 46 | |
| 47 | // getNvidiaSMIPath returns path to the `nvidia-smi` executable in the driver root. |
| 48 | func (r root) getNvidiaSMIPath() (string, error) { |
| 49 | binarySearchPaths := []string{ |
| 50 | "/usr/bin", |
| 51 | "/usr/sbin", |
| 52 | "/bin", |
| 53 | "/sbin", |
| 54 | } |
| 55 | |
| 56 | binaryPath, err := r.findFile("nvidia-smi", binarySearchPaths...) |
| 57 | if err != nil { |
| 58 | return "", err |
| 59 | } |
| 60 | |
| 61 | return binaryPath, nil |
| 62 | } |
| 63 | |
| 64 | // isDevRoot checks whether the specified root is a dev root. |
| 65 | // A dev root is defined as a root containing a /dev folder. |
no test coverage detected