MCPcopy
hub / github.com/google/gvisor / ListSupportedDrivers

Function ListSupportedDrivers

tools/gpu/drivers/install_driver.go:230–250  ·  view source on GitHub ↗

ListSupportedDrivers prints the driver to stderr in a format that can be consumed by the Makefile to iterate tests across drivers.

(outfile string)

Source from the content-addressed store, hash-verified

228// ListSupportedDrivers prints the driver to stderr in a format that can be
229// consumed by the Makefile to iterate tests across drivers.
230func ListSupportedDrivers(outfile string) error {
231 out := os.Stdout
232 if outfile != "" {
233 f, err := os.OpenFile(outfile, os.O_WRONLY, 0644)
234 if err != nil {
235 return fmt.Errorf("failed to open outfile: %w", err)
236 }
237 defer f.Close()
238 out = f
239 }
240
241 var list []string
242 nvproxy.ForEachSupportDriver(func(version nvconf.DriverVersion, _ nvproxy.Checksums) {
243 list = append(list, version.String())
244 })
245 sort.Strings(list)
246 if _, err := out.WriteString(strings.Join(list, " ") + "\n"); err != nil {
247 return fmt.Errorf("failed to write to outfile: %w", err)
248 }
249 return nil
250}
251
252// ChecksumDriver downloads and returns the SHA265 checksum of the driver.
253func (i *Installer) ChecksumDriver(ctx context.Context, arch string) (string, error) {

Callers 1

mainFunction · 0.92

Calls 6

ForEachSupportDriverFunction · 0.92
ErrorfMethod · 0.65
CloseMethod · 0.65
StringMethod · 0.65
JoinMethod · 0.65
WriteStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…