Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
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
27 changes: 27 additions & 0 deletions pkg/standalone/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -272,6 +273,32 @@ func CreateControllerContainer(ctx context.Context, dockerClient *client.Client,
hostConfig.DeviceRequests = []container.DeviceRequest{{Count: -1, Capabilities: [][]string{{"gpu"}}}}
}

// devicePaths contains glob patterns for common AI accelerator device files.
// Enable access to AI accelerator devices if they exist
devicePaths := []string{
"/dev/dri", // Direct Rendering Infrastructure (used by Vulkan, Mesa, Intel/AMD GPUs)
"/dev/kfd", // AMD Kernel Fusion Driver (for ROCm)
"/dev/accel", // Intel accelerator devices
"/dev/davinci*", // TI DaVinci video processors
"/dev/devmm_svm", // Huawei Ascend NPU
"/dev/hisi_hdc", // Huawei Ascend NPU
}

for _, path := range devicePaths {
devices, err := filepath.Glob(path)
if err != nil {
// Skip on glob error, don't fail container creation
continue
}
for _, device := range devices {
hostConfig.Devices = append(hostConfig.Devices, container.DeviceMapping{
PathOnHost: device,
PathInContainer: device,
CgroupPermissions: "rwm",
})
}
}

// Create the container. If we detect that a concurrent installation is in
// progress (as indicated by a conflicting container name (which should have
// been detected just before installation)), then we'll allow the error to
Expand Down
Loading