
# CCE AI套件（NVIDIA GPU）
#### 插件介绍
CCE AI套件（NVIDIA GPU）插件是支持在容器中使用GPU显卡的设备管理插件，集群中使用GPU节点时必须安装本插件。
#### 字段说明
表1参数描述 
| 参数     | 是否必选 | 参数类型                                            | 描述        |
|:---|:---|:---|:---|
| basic  | 是    | object                                          | 插件基础配置参数。 |
| custom | 是    | [表3] object | 插件自定义参数   |
   
表2basic 
| 参数              | 是否必选 | 参数类型   | 描述                                              |
|:---|:---|:---|:---|
| cluster_version | 否    | String | CCE集群版本                                         |
| device_version  | 是    | String | 插件的版本                                           |
| driver_version  | 是    | String | 插件安装驱动时，插件里负责安装驱动的Pod的镜像tag，一般与device_version相同 |
| obs_url         | 是    | String | 当从默认驱动地址中下载GPU驱动时，该值为GPU的驱动地址                   |
| region          | 是    | String | 集群所在的区域                                         |
| swr_addr        | 是    | String | 镜像仓库地址                                          |
| swr_user        | 是    | String | 镜像仓库租户路径                                        |
   
 表3custom 
| 参数                         | 是否必选 | 参数类型   | 描述                                                                                                          |
|:---|:---|:---|:---|
| compatible_with_legacy_api | 否    | Bool   | API兼容开关 默认值：false true：插件支持GPU卡原生模式和XGPU虚拟化模式。 |
| component_schedulername    | 是    | String | 插件使用的调度器的名字 默认值：default-scheduler                                              |
| disable_mount_path_v1      | 否    | Bool   | 默认值：false true：不将/opt/cloud/cce/nvidia挂载到GPU容器的/usr/lib/nvidia路径上                |
| disable_nvidia_gsp         | 否    | Bool   | 默认值：true true：关闭GPU的GSP firmware                                             |
| driver_mount_paths         | 否    | String | 自动挂载到GPU容器里的路径 默认值："bin,lib64"                                               |
| enable_fault_isolation     | 否    | Bool   | 默认值：true true：插件识别GPU硬件故障或驱动程序问题，设置GPU卡不可用                                     |
| enable_health_monitoring   | 否    | Bool   | 默认值：true true：插件能够识别GPU硬件故障或驱动程序问题                                              |
| enable_metrics_monitoring  | 否    | Bool   | 默认值：true true：收集GPU指标，并且上报到prometheus                                        |
| enable_simple_lib64_mount  | 否    | Bool   | 默认值：true true：向容器里只挂载libxxx.so.x文件                                            |
| enable_xgpu                | 否    | Bool   | 默认值：false XGPU虚拟化模式的开关                                                        |
| gpu_driver_config          | 否    | Map    | 针对单个节点池的GPU驱动的相关配置 默认值：{}                                                     |
| health_check_xids_v2       | 否    | String | 插件健康检查的GPU错误的范围 默认值："74,79"                                                   |
| inject_ld_Library_path     | 否    | String | 插件向GPU容器中自动注入的LD_LIBRARY_PATH环境变量的值 默认值：""                                    |
| lib64_container_paths      | 否    | String | Nvidia lib64在GPU容器里的挂载路径 默认值："/usr/lib64,/usr/lib/x86_64-linux-gnu"           |
| metrics_delete_interval    | 否    | int    | 无法获取某个指标时，删除这个指标的超时阈值，单位毫秒 默认值：30000                                           |
| metrics_monitor_interval   | 否    | int    | 获取指标的时间间隔，单位毫秒 默认值：15000                                                      |
| nvidia_driver_download_url | 是    | String | Nvidia驱动下载的路径 默认值：""                                                           |
| is_driver_from_nvidia      | 否    | Bool   | 当使用自定义链接或者通过调用接口安装插件（例如，Terraform）时，该值应为true，使驱动下载链接保持和输入一致。 默认值：true          |
   
#### 请求示例
```
{
  "kind": "Addon",
  "apiVersion": "v3",
  "metadata": {
    "name": "gpu-beta"
  },
  "spec": {
    "clusterID": "80c9e306-***-***-***-0255ac100043",
    "version": "2.0.69",
    "addonTemplateName": "gpu-beta",
    "values": {
      "basic": {
        "cluster_version": "v1.27",
        "device_version": "2.0.69",
        "driver_version": "2.0.69",
        "obs_url": "***",
        "region": "***",
        "swr_addr": "***",
        "swr_user": "***"
      },
      "custom": {
        "compatible_with_legacy_api": true,
        "component_schedulername": "kube-scheduler",
        "disable_mount_path_v1": false,
        "disable_nvidia_gsp": true,
        "driver_mount_paths": "bin,lib64",
        "enable_fault_isolation": true,
        "enable_health_monitoring": true,
        "enable_metrics_monitoring": true,
        "enable_simple_lib64_mount": true,
        "enable_xgpu": true,
        "gpu_driver_config": {},
        "health_check_xids_v2": "74,79",
        "inject_ld_Library_path": "",
        "is_driver_from_nvidia": true,
        "lib64_container_paths": "/usr/lib64,/usr/lib/x86_64-linux-gnu",
        "metrics_delete_interval": 30000,
        "metrics_monitor_interval": 15000,
        "nvidia_driver_download_url": ""
      }
    }
  }
}
```
