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
9 changes: 6 additions & 3 deletions internal/util/gpu/gpu.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package gpu

import "os/exec"
import (
"os"
"os/exec"
)

// Supported checks whether GPU sharing is supported by the system, based
// on either NVidia or AMD toolkits being instead.
Expand All @@ -16,8 +19,8 @@ func Supported(runner string) (string, bool) {
}
return "--gpus=all", true
}
// AMD GPU.
if path, _ := exec.LookPath("rocm-smi"); path != "" {
// AMD GPU based on AMD Kernel Fusion Driver.
if _, err := os.Stat("/dev/kfd"); err == nil {
return "--device=/dev/kfd", true
}
return "", false
Expand Down
Loading