From db8d975012b2ab3de7e0e789c565b27c755c3438 Mon Sep 17 00:00:00 2001 From: Anthony Nandaa Date: Wed, 12 Feb 2025 10:37:29 +0300 Subject: [PATCH] fix: cdi: add appdefaults.CDISpecDirs for windows Since CDI support is enabled by default, add a default CDI spec directory for Windows. Without this, the buildkitd fails to start with error: buildkitd: No CDI specification directories specified Also add a note on the docs that the support is yet to be tested on Windows. Signed-off-by: Anthony Nandaa --- docs/cdi.md | 3 +++ util/appdefaults/appdefaults_windows.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/cdi.md b/docs/cdi.md index ff1668115f4c..40beadd1aa56 100644 --- a/docs/cdi.md +++ b/docs/cdi.md @@ -8,6 +8,9 @@ name. Since BuildKit 0.20.0, you can access devices using the CDI interface. This allows you to use devices like GPUs in your builds. +> [!NOTE] +> CDI support is yet to be tested on Windows. + ## Usage To use CDI with BuildKit, you need to create the [CDI configuration file](https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md#cdi-json-specification) diff --git a/util/appdefaults/appdefaults_windows.go b/util/appdefaults/appdefaults_windows.go index c2103887a341..6917469fe045 100644 --- a/util/appdefaults/appdefaults_windows.go +++ b/util/appdefaults/appdefaults_windows.go @@ -18,7 +18,7 @@ var ( var ( UserCNIConfigPath = DefaultCNIConfigPath - CDISpecDirs []string + CDISpecDirs = []string{filepath.Join(os.Getenv("ProgramData"), "buildkitd", "cdi")} ) func UserAddress() string {