Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions runner/internal/common/gpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const (
)

func GetGpuVendor() GpuVendor {
// FIXME: There might be errors other than os.ErrNotExist that are ignored silently.
// Propagate and log.
if _, err := os.Stat("/dev/kfd"); !errors.Is(err, os.ErrNotExist) {
return GpuVendorAmd
}
Expand All @@ -28,5 +30,11 @@ func GetGpuVendor() GpuVendor {
if _, err := os.Stat("/dev/tenstorrent"); !errors.Is(err, os.ErrNotExist) {
return GpuVendorTenstorrent
}
if _, err := os.Stat("/dev/dxg"); !errors.Is(err, os.ErrNotExist) {
// WSL2
if _, err := os.Stat("/usr/lib/wsl/lib/nvidia-smi"); !errors.Is(err, os.ErrNotExist) {
return GpuVendorNvidia
}
}
return GpuVendorNone
}