本文介绍通过阿里云Prometheus对GPU资源进行监控,查看GPU各项指标。
前提条件
您已完成以下操作:- 创建托管GPU集群或创建专有GPU集群。
- 开通阿里云Prometheus服务。
- 已安装阿里云Prometheus监控。具体操作,请参见阿里云Prometheus监控。
使用阿里云Prometheus进行GPU监控
- 登录容器服务管理控制台。
- 在集群列表页面中,单击目标集群名称或者目标集群右侧操作列下的详情。
- 在集群管理页左侧导航栏中,选择 。
- 在Prometheus监控大盘列表页面,单击GPU APP和GPU Node页签,您分别可以看到GPU APP和GPU Node两个监控大盘。
- GPU APP用于监控Pod的GPU使用情况。
- GPU Node用于监控集群节点的GPU使用情况。
- 使用以下YAML文件在GPU节点上部署一个服务,测试监控效果。
apiVersion: apps/v1 kind: Deployment metadata: name: bert-intent-detection spec: replicas: 1 selector: matchLabels: app: bert-intent-detection template: metadata: labels: app: bert-intent-detection spec: containers: - name: bert-container image: registry.cn-beijing.aliyuncs.com/ai-samples/bert-intent-detection:1.0.1 ports: - containerPort: 80 resources: limits: nvidia.com/gpu: 1 --- apiVersion: v1 kind: Service metadata: labels: run: bert-intent-detection name: bert-intent-detection-svc spec: ports: - port: 8500 targetPort: 80 selector: app: bert-intent-detection type: LoadBalancer
- 在Prometheus监控大盘列表页面,单击GPU APP页签。在GPU APP监控页面,您可以看到GPU显存、使用率、电量、稳定性几项指标,以及部署在GPU节点上的应用。
- 压测部署在GPU节点上的应用,查看监控状态的变化。