-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CDI --device support to --oci mode #1394
Comments
Thanks for creating this @dtrudg. This is similar to the Podman interoperability where I recently updated the support. The injection there happens here and is triggered if a device path is a fully-qualified CDI device name (e.g.
call. The registry scans configured directories for CDI specs and matches the requested devices to these. The processing of the device flag happens here. Note that this does not cover CDI spec generation -- which is vendor specific -- and is kept out-of-band of spec consumption for OCI runtime spec (or other) modification. |
++ |
@preminger - the steps for implementing this are roughly as follows...
At some point in the code there will need to be some parsing / checks of the values provided to the Initially, you can test this without an NVIDIA GPU, by writing a test CDI configuration file, that binds some arbitrary device and libraries into the container. Later we'll have to test it on a system with an NVIDIA GPU, and write an e2e GPU test for it. Before starting, it'd be useful to read about, and experiment with, the functional options pattern - https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis We are trying to use this pattern for any area of the code that might be expose as a public API, as it allows extending the API easily without breaking things. |
WIth regards to:
This is done in When performing injection as is done here a CDI registry is created and the fully-qualified devices are passed for injection. If these devices are not known (i.e. not present in any CDI specification loaded by the registry from the configured folders), then the In terms of configuration, for For For In terms of test devices, Feel free to reach out if you have any questions. |
Is your feature request related to a problem? Please describe.
SingularityCE doesn't currently support the new CDI standard for making hardware devices available in containers.
The
--oci
experimental runtime mode currently exposes only a naive binding approach to add devices and libraries to a container, via the--nv
and--oci
flags.The
--nv
and--oci
approach cannot support a range of functionality that is valuable, such as masking specific GPUs, introducing only subsets of device functionality into a container etc. In addition it is vendor specific, but we'd like to support e.g. Intel GPUs #1094Describe the solution you'd like
The experimental
--oci
runtime mode should support a--device
flag, allowing the user to request a device is made available in the container using a CDI configuration.Additional context
Because
--oci
mode is based on OCI runtime spec generation, and invocation ofrunc
/crun
, it should be simple to implement support via spec modification carried out in the CDI module - https://github.com/container-orchestrated-devices/container-device-interface/tree/main/pkg/cdiThe text was updated successfully, but these errors were encountered: