@@ -721,6 +721,12 @@ RUN --device=name,[required]
721721` RUN --device ` allows build to request [ CDI devices] ( https://github.com/moby/buildkit/blob/master/docs/cdi.md )
722722to be available to the build step.
723723
724+ > [ !WARNING]
725+ > The use of ` --device ` is protected by the ` device ` entitlement, which needs
726+ > to be enabled when starting the buildkitd daemon with
727+ > ` --allow-insecure-entitlement device ` flag or in [ buildkitd config] ( https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md ) ,
728+ > and for a build request with [ ` --allow device ` flag] ( https://docs.docker.com/engine/reference/commandline/buildx_build/#allow ) .
729+
724730The device ` name ` is provided by the CDI specification registered in BuildKit.
725731
726732In the following example, multiple devices are registered in the CDI
@@ -752,6 +758,8 @@ devices:
752758 containerEdits :
753759 env :
754760 - QUX=injected
761+ annotations :
762+ org.mobyproject.buildkit.device.autoallow : true
755763` ` `
756764
757765The device name format is flexible and accepts various patterns to support
@@ -762,6 +770,14 @@ multiple device configurations:
762770* `vendor1.com/device=*`: request all devices for this vendor
763771* `class1`: request devices by `org.mobyproject.buildkit.device.class` annotation
764772
773+ > [!NOTE]
774+ > Annotations are supported by the CDI specification since 0.6.0.
775+
776+ > [!NOTE]
777+ > To automatically allow all devices registered in the CDI specification, you
778+ > can set the `org.mobyproject.buildkit.device.autoallow` annotation. You can
779+ > also set this annotation for a specific device.
780+
765781# ### Example: CUDA-Powered LLaMA Inference
766782
767783In this example we use the `--device` flag to run `llama.cpp` inference using
0 commit comments