# k8s-device-plugin **Repository Path**: BirenTechnology/k8s-device-plugin ## Basic Information - **Project Name**: k8s-device-plugin - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-02-05 - **Last Updated**: 2025-03-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Biren GPU Device plugin ## About The Biren GPU device plugin is as Daemonset that allows you to automatically: 1. Expose the number of GPUs on each nodes for you cluster 2. Keep track of the health of your GPUs 3. Run GPU enabled containers in your k8s cluster This repository contains Biren's official implementation of the [k8s device plugin](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/resource-management/device-plugin.md) ## Prerequisites The list of prerequisites for running the Biren device plugin is described below: 1. Biren GPU Driver >= 1.2.2 2. Kubernetes >=1.13 3. if need mount dri device, need run `modprobe -v vgem` in host which have gpus ## SVI in Device plugin 1. SVI devices will not be created dynamically anywhere within the k8s software stack (GPU must be configured into svi card and split into svi devices priori) ## SR-IOV in device plugin 1. setup SR-IOV vfio driver 2. run device plugin with --container-runtime kata ## Quick Start ### Build Image ``` make image-build ``` ### Deploy `kubectl create -f deploy/biren-device-plugin.yaml` ### Running GPU Pods ``` $ cat <= 1.28 - containerd >= 1.7.0 ### How to use it #### kubelet In kubelet version 1.28, the CDI feature is in alpha state, so it needs to be enabled manually. To do this, add the `--feature-gates=DevicePluginCDIDevices=true` argument to the kubelet startup command. #### containerd Modify the containerd configuration file as follows: ```toml [plugins."io.containerd.grpc.v1.cri"] cdi_spec_dirs = ["/etc/cdi", "/var/run/cdi"] enable_cdi = true ``` #### k8s-device-plugin Add the startup command parameter `--cdi-feature` to enable the CDI feature. If the CDI feature is enabled, this will generate a biren.yaml file in the node's `/etc/cdi` directory, which defines the configuration of CDI. If the startup command parameter includes `--overwrite-cdi-config`, the configuration file will be overwritten each time it starts. Otherwise, if the biren.yaml configuration file already exists, it will not be overwritten. k8s-device-plugin startup command example: ```yaml command: - "/root/k8s-device-plugin" args: - "--pulse" - "300" - "--container-runtime" - "runc" - "--cdi-feature" # enable cdi feature - "--overwrite-cdi-config" # overwrite cdi config ```