You can use Telegraf to collect NVIDIA GPU monitoring data and then use Logtail to upload the data to a MetricStore in Simple Log Service. This lets you visualize and monitor your NVIDIA GPUs. This topic describes how to collect and visualize NVIDIA GPU monitoring data using Simple Log Service.
Prerequisites
A project and a MetricStore are created. For more information, see Manage projects and Create a MetricStore.
Limits
Only Logtail 0.16.50 or later for Linux supports the collection of NVIDIA GPU monitoring data. If you have an earlier version of Logtail installed on your server, you must upgrade it. For more information, see Install Logtail (Linux).
Step 1: Install an NVIDIA GPU driver
Simple Log Service uses the nvidia-smi command to collect GPU information. Because this command is included in the GPU driver, you must install the driver first. For more information, see Manually install the Tesla driver on a GPU-accelerated compute-optimized Linux instance. If you use a GPU-accelerated instance of Elastic Compute Service (ECS), the driver is installed by default. In this case, you can skip this step.
Step 2: Create a Logtail collection configuration
Log on to the Simple Log Service console.
In the Import Data section, on the Monitoring Data tab, click NVIDIA GPU Monitoring.
Select the target project and Metricstore, and then click Next.

On the Create Machine Group tab:
If you have an available machine group, click Use Existing Machine Group.

If no machine groups are available, perform the following steps to create a machine group. In this example, an Elastic Compute Service (ECS) instance is used.
On the ECS Instances tab, select the target ECS instance under Manually Select Instances, and then click Create.
For more information, see Install Logtail on ECS instances.
ImportantIf you want to collect logs from an ECS instance that belongs to a different Alibaba Cloud account than Simple Log Service, a server in a data center, or a server of a third-party cloud service provider, you must manually install Logtail. For more information, see Install Logtail on a Linux server. After you manually install Logtail, you must configure a user identifier for the server. For more information, see Configure a user identifier.
After Logtail is installed, click Complete Installation.
In the Create Machine Group step, configure the Name parameter and click Next.
Simple Log Service lets you create IP-based machine groups and custom identifier-based machine groups. For more information, see Create a machine group.
Confirm that the machine group is displayed in the Applied Server Groups section and click Next.
ImportantIf you apply a machine group immediately after you create the machine group, the heartbeat status of the machine group may be FAIL. This issue occurs because the machine group is not connected to Simple Log Service. To resolve this issue, you can click Automatic Retry. If the issue persists, see What do I do if no heartbeat connections are detected on Logtail?
On the Data Source tab, configure the following parameters.
Parameter name
Description
Configuration Name
Enter a name for the Logtail collection configuration.
Cluster Name
Enter a name for the Nvidia GPU cluster.
After you configure this parameter, Simple Log Service adds a cluster=Cluster name tag to the NVIDIA GPU monitoring data that is collected using the Logtail configuration.
ImportantMake sure that the cluster name is unique. Otherwise, data conflicts may occur.
Nvidia SMI Path
The path where the nvidia-smi command is installed. The default value is /usr/bin/nvidia-smi.
Custom Tags
Add custom tags to the collected Nvidia GPU monitoring data. The tags are key-value pairs.
After you set this parameter, Simple Log Service adds the tags to the Nvidia GPU monitoring data that is collected using this Logtail configuration.
FAQ
How can I check whether Telegraf collects data as expected?
You can check the logs of the /etc/ilogtail/telegraf/telegraf.log file on your server. You can also collect this log file to Log Service and search for the required information.
What to do next
- Search and analyze
After you complete the settings, Telegraf uses the Logtail to upload collected metrics to the Metricstore of Log Service. You can query the data on the Search & Analysis page of the Metricstore. For more information, see Query and analyze time series data.
Visualization
After you configure NVIDIA GPU monitoring, Simple Log Service automatically creates a dashboard named NVIDIA_GPU_Monitoring_Cluster Name in the project. You can use this dashboard directly. You can also configure alerts and perform other operations.