Supervisa el rendimiento de las GPU en las VM de Linux
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Linux
Puedes hacer un seguimiento de las métricas, como el uso de GPU y la memoria de GPU de tus instancias de máquina virtual (VM) mediante el Agente de operaciones, que es la solución de recopilación de telemetría recomendada de Google para Compute. Engine.
Con el Agente de operaciones, puedes administrar tus VMs de GPU de la siguiente manera:
Visualiza el estado de tu flota de GPU de NVIDIA con nuestros paneles
preconfigurados.
Identifica las GPU con poco uso y consolida las cargas de trabajo para optimizar los costos.
Planifica el escalamiento mediante la observación de las tendencias para decidir cuándo expandir la capacidad de la GPU o actualizar las GPU existentes.
Usa las métricas de perfilado del administrador de GPU del centro de datos de NVIDIA (DCGM) para identificar cuellos de botella y problemas de rendimiento dentro de las GPU.
Recibe alertas sobre las métricas de tus GPU de NVIDIA.
En este documento, se abordan los procedimientos para supervisar GPU en VMs de Linux mediante el Agente de operaciones. Como alternativa, hay una secuencia de comandos de informes disponible en GitHub que también se puede configurar para supervisar el uso de GPU en las VMs de Linux. Consulta secuencia de comandos de supervisióncompute-gpu-monitoring.
Esta secuencia de comandos no se mantiene de forma activa.
El Agente de operaciones, versión 2.38.0 o posterior, puede realizar un seguimiento automático del uso de GPU y las tasas de uso de memoria de GPU en tus VMs de Linux que tienen el agente instalado. Se realiza un seguimiento de estas métricas, obtenidas de la biblioteca de administración de NVIDIA (NVML), por GPU y por proceso para cualquier proceso que use GPU.
Si deseas ver las métricas que supervisa el Agente de operaciones, consulta Métricas del agente: gpu.
También puedes configurar la integración del administrador de GPU del centro de datos de NVIDIA (DCGM) con el Agente de operaciones. Esta integración permite que el Agente de operaciones realice un seguimiento de las métricas mediante los contadores de hardware en la GPU. DCGM proporciona acceso a las métricas a nivel de dispositivo de GPU. Estos incluyen el uso de bloques de Streaming MultiProcessor (SM), la ocupación de SM, la utilización de la canalización de SM, la tasa de tráfico de PCIe y la tasa de tráfico de NVLink. Para ver las métricas supervisadas por el Agente de operaciones, consulta Métricas de aplicaciones de terceros: Administrador de GPU del centro de datos de NVIDIA (DCGM).
Para revisar las métricas de GPU mediante el Agente de operaciones, completa los siguientes pasos:
El sistema operativo Linux y la versión para cada una de tu VMs deben ser compatibles con el Agente de operaciones. Consulta la lista de sistemas operativos de Linux que admiten el Agente de operaciones.
Asegúrate de tener acceso sudo a cada VM.
Instalar el Agente de operaciones.
Para instalar el Agente de operaciones, completa los siguientes pasos:
Si usabas la compute-gpu-monitoring secuencia de comandos de supervisión
para hacer un seguimiento del uso de la GPU, inhabilita el servicio antes de instalar el Agente de operaciones.
Para inhabilitar la secuencia de comandos de supervisión, ejecuta el siguiente comando:
Puedes revisar las métricas de NVML que el agente de operaciones recopila en las pestañas de Observabilidad para las instancias de VM de Linux de Compute Engine.
Para ver las métricas de una sola VM, haz lo siguiente:
En la Google Cloud consola, ve a la página Instancias de VM.
Opcional: configura la integración del administrador de GPU del centro de datos de NVIDIA (DCGM)
El Agente de operaciones también proporciona integración para el administrador de GPU del centro de datos
de NVIDIA (DCGM) para recopilar métricas clave de GPU avanzadas, como el uso del bloque de multiprocesador de transmisión (SM),
la ocupación del SM, el uso de canalizaciones del SM, la tasa de tráfico de PCIe
y la tasa de tráfico de NVLink.
Estas métricas avanzadas de GPU no se recopilan de los modelos NVIDIA P100 y P4.
En el campo Filtrofilter_list, escribe NVIDIA. Aparecerá el panel
Descripción general de NVIDIA GPU Monitoring (GCE y GKE).
Si configuraste la integración del administrador de GPU del centro de datos de NVIDIA (DCGM), también se muestra el panel Métricas del DCGM de NVIDIA GPU Monitoring Advanced (solo GCE).
En el panel obligatorio, haz clic en Vista previa. Aparecerá la página Vista previa del panel de muestra.
En la página Panel de vista previa de muestra, haz clic en Importar panel de muestra.
En el panel Descripción general de GPU de NVIDIA Monitoring (GCE y GKE), se muestran las métricas de GPU, como el uso de GPU, la tasa de tráfico de NIC y el uso de memoria de GPU.
La pantalla de uso de la GPU es similar al siguiente resultado:
El panel Métricas de DCGM de GPU de NVIDIA Monitoring Advanced (solo GCE) muestra métricas avanzadas clave, como el uso de SM, la ocupación de SM, el uso de canalizaciones de SM, la tasa de tráfico de PCIe y la tasa de tráfico NVLink.
La pantalla de la métrica Advanced DCGM es similar al siguiente resultado:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eThe Ops Agent, version 2.38.0 or later, is Google's recommended solution for tracking GPU utilization and memory on Linux virtual machines (VMs) and can manage your GPU VMs.\u003c/p\u003e\n"],["\u003cp\u003eUsing the Ops Agent, you can visualize GPU fleet health, optimize costs, plan scaling, identify bottlenecks with NVIDIA Data Center GPU Manager (DCGM) profiling metrics, and set alerts.\u003c/p\u003e\n"],["\u003cp\u003eThe Ops Agent collects metrics from the NVIDIA Management Library (NVML) and, with optional DCGM integration, can track advanced GPU metrics such as Streaming Multiprocessor utilization and PCIe traffic rate.\u003c/p\u003e\n"],["\u003cp\u003eTo use the Ops Agent, users must ensure their VMs have attached GPUs, installed GPU drivers, and support the Ops Agent with their Linux operating system, in addition to installing the agent.\u003c/p\u003e\n"],["\u003cp\u003eYou can review NVML metrics within the Compute Engine's Observability tab and review DCGM metrics in the Monitoring section, with provided dashboards.\u003c/p\u003e\n"]]],[],null,["# Monitoring GPU performance on Linux VMs\n\nLinux\n\n*** ** * ** ***\n\n| **Tip:** If you want to monitor A4 or A3 Ultra machine types that are deployed using the features provided by Cluster Director, see [Monitor VMs and clusters](/ai-hypercomputer/docs/monitor) in the AI Hypercomputer documentation instead.\n\nYou can track metrics such as GPU utilization and GPU memory from your\nvirtual machine (VM) instances by using the\n[Ops Agent](/stackdriver/docs/solutions/agents/ops-agent), which is\nGoogle's recommended telemetry collection solution for Compute Engine.\nBy using the Ops Agent, you can manage your GPU VMs as follows:\n\n- Visualize the health of your NVIDIA GPU fleet with our pre-configured dashboards.\n- Optimize costs by identifying underutilized GPUs and consolidating workloads.\n- Plan scaling by looking at trends to decide when to expand GPU capacity or upgrade existing GPUs.\n- Use NVIDIA Data Center GPU Manager (DCGM) profiling metrics to identify bottlenecks and performance issues within your GPUs.\n- Set up [managed instance groups (MIGs)](/compute/docs/instance-groups#managed_instance_groups) to autoscale resources.\n- Get alerts on metrics from your NVIDIA GPUs.\n\nThis document covers the procedures for monitoring GPUs on Linux VMs by using\nthe Ops Agent. Alternatively, a reporting script is available on GitHub that can\nalso be setup for monitoring GPU usage on Linux VMs, see\n[`compute-gpu-monitoring` monitoring script](https://github.com/GoogleCloudPlatform/compute-gpu-monitoring/tree/main/linux).\nThis script is not actively maintained.\n\nFor monitoring GPUs on Windows VMs, see\n[Monitoring GPU performance (Windows)](/compute/docs/gpus/monitor-gpus-windows).\n\nOverview\n--------\n\nThe Ops Agent, version 2.38.0 or later, can automatically track GPU\nutilization and GPU memory usage rates on your Linux VMs that have the agent\ninstalled. These metrics, obtained from the NVIDIA Management Library (NVML),\nare tracked per GPU and per process for any process that uses GPUs.\nTo view the metrics that are monitored by the Ops Agent,\nsee [Agent metrics: gpu](/monitoring/api/metrics_opsagent#agent-gpu).\n\nYou can also set up the NVIDIA Data Center GPU Manager (DCGM) integration with\nthe Ops Agent. This integration allows the Ops Agent to track metrics\nusing the hardware counters on the GPU. DCGM provides access to the\nGPU device-level metrics. These include Streaming Multiprocessor (SM)\nblock utilization, SM occupancy, SM pipe utilization, PCIe traffic rate,\nand NVLink traffic rate. To view the metrics monitored by the Ops Agent, see\n[Third-party application metrics: NVIDIA Data Center GPU Manager (DCGM)](/monitoring/api/metrics_opsagent#opsagent-dcgm).\n\nTo review GPU metrics by using the Ops Agent, complete the following steps:\n\n1. On each VM, check that you have met [the requirements](#requirements).\n2. On each VM, [install the Ops Agent](#install-ops-agent).\n3. Optional: On each VM, set up the [NVIDIA Data Center GPU Manager (DCGM) integration](#dcgm).\n4. Review [metrics in Cloud Monitoring](#review-metrics-dashboard).\n\nLimitations\n-----------\n\n- The Ops Agent doesn't track GPU utilization on VMs that use Container-Optimized OS.\n\nRequirements\n------------\n\nOn each of your VMs, check that you meet the following requirements:\n\n- Each VM must have [GPUs attached](/compute/docs/gpus/create-vm-with-gpus).\n- Each VM must have a [GPU driver installed](/compute/docs/gpus/install-drivers-gpu#verify-driver-install).\n- The Linux operating system and version for each of your VM must support the Ops Agent. See the list of [Linux operating systems](/stackdriver/docs/solutions/agents/ops-agent#linux_operating_systems) that support the Ops Agent.\n- Ensure you have `sudo` access to each VM.\n\nInstall the Ops Agent\n---------------------\n\nTo install the Ops Agent, complete the following steps:\n\n1. If you were previously using the\n [`compute-gpu-monitoring` monitoring script](https://github.com/GoogleCloudPlatform/compute-gpu-monitoring/tree/main/linux)\n to track GPU utilization, disable the service before installing the Ops Agent.\n To disable the monitoring script, run the following command:\n\n ```\n sudo systemctl --no-reload --now disable google_gpu_monitoring_agent\n ```\n2. Install the latest version of the Ops Agent. For detailed instructions, see\n [Installing the Ops Agent](/stackdriver/docs/solutions/agents/ops-agent/install-index).\n\n3. After you have installed the Ops agent, if you need to install or upgrade your\n GPU drivers by using the\n [installation scripts provided by Compute Engine](/compute/docs/gpus/install-drivers-gpu#installation_scripts),\n review the *limitations* section.\n\nReview NVML metrics in Compute Engine\n-------------------------------------\n\nYou can review the NVML metrics that the Ops Agent collects from the\n**Observability** tabs for Compute Engine Linux VM instances.\n\nTo view the metrics for a single VM do the following:\n\n1. In the Google Cloud console, go to the **VM instances** page.\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n2. Select a VM to open the **Details** page.\n\n3. Click the **Observability** tab to display information about the VM.\n\n4. Select the **GPU** quick filter.\n\nTo view the metrics for multiple VMs, do the following:\n\n1. In the Google Cloud console, go to the **VM instances** page.\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n2. Click the **Observability** tab.\n\n3. Select the **GPU** quick filter.\n\nOptional: Set up NVIDIA Data Center GPU Manager (DCGM) integration\n------------------------------------------------------------------\n\nThe Ops Agent also provides integration for NVIDIA Data Center GPU Manager\n(DCGM) to collect key advanced GPU metrics such as Streaming Multiprocessor (SM)\nblock utilization, SM occupancy, SM pipe utilization, PCIe traffic rate,\nand NVLink traffic rate.\n\nThese advanced GPU metrics are not collected from NVIDIA P100 and P4 models.\n\nFor detailed instructions on how to setup and use this integration on each VM,\nsee [NVIDIA Data Center GPU Manager (DCGM)](/stackdriver/docs/solutions/agents/ops-agent/third-party-nvidia).\n\nReview DCGM metrics in Cloud Monitoring\n---------------------------------------\n\n1. In the Google Cloud console, go to the **Monitoring \\\u003e Dashboards** page.\n\n [Go to Monitoring](https://console.cloud.google.com/monitoring/dashboards)\n2. Select the **Sample Library** tab.\n\n3. In the filter_list **Filter** field,\n type **NVIDIA** . The\n **NVIDIA GPU Monitoring Overview (GCE and GKE)**\n dashboard displays.\n\n If you have set up the NVIDIA Data Center GPU Manager (DCGM) integration, the\n **NVIDIA GPU Monitoring Advanced DCGM Metrics (GCE Only)**\n dashboard also displays.\n\n4. For the required dashboard, click **Preview** . The **Sample dashboard preview**\n page displays.\n\n5. From the **Sample dashboard preview** page, click **Import sample dashboard**.\n\n - The **NVIDIA GPU Monitoring Overview (GCE and GKE)**\n dashboard displays the GPU metrics such as GPU utilization, NIC traffic rate,\n and GPU memory usage.\n\n Your GPU utilization display is similar to the following output:\n\n - The\n **NVIDIA GPU Monitoring Advanced DCGM Metrics (GCE Only)**\n dashboard displays key advanced metrics such as SM utilization, SM occupancy,\n SM pipe utilization, PCIe traffic rate, and NVLink traffic rate.\n\n Your Advanced DCGM Metric display is similar to the following output:\n\nWhat's next?\n------------\n\n- To handle GPU host maintenance, see [Handling GPU host maintenance events](/compute/docs/gpus/gpu-host-maintenance).\n- To improve network performance, see [Use higher network bandwidth](/compute/docs/gpus/optimize-gpus)."]]