"connecting to container runtime failed" Is Displayed in Logs
Symptom
No NPU container information is obtained through the Metrics interface (http://ip:port/metrics) of NPU Exporter. The logs of the component contain the following information:
failed to init devices parser: connecting to container runtime failed: context deadline exceeded
Cause Analysis
The default socket file paths of the NPU Exporter parameters -containerd and-endpoint are incorrect. The file paths vary according to the OS.
Solution
- The default value (docker) of the NPU Exporter parameter -containerMode indicates that Kubernetes uses Docker as the container runtime. In this case, you need to configure -containerd and -endpoint accordingly. You can locate the socket and modify the YAML mounting path and NPU Exporter startup parameters by referring to Table 1. Then restart the service.
- If -containerMode is containerd, perform the same operations. But, you need to delete the mount path whose name is docker-shim from the YAML file at the same time.
Startup Parameter |
Container Mode |
Description |
|---|---|---|
-containerd |
|
Generally, retain the default value of this parameter unless you change the sock file path of containerd. You can run the ps aux | grep "containerd.sock" command to query the path. |
-endpoint |
|
Generally, retain the default value unless you have changed the sock file path of Dockershim or containerd. |
Parent topic: Faults During Installation