C/C++ API#

This section is the exhaustive reference for DCGM’s public programmatic interfaces, data structures, enumerations, entities, fields, and modules. For conceptual introductions and operational workflows, start with Learn.

Field identifiers are shared by command-line and programmatic interfaces. Their canonical catalogue is in Field Identifiers.

Linking C/C++ Clients#

The development package supplies two ways to link a C or C++ client. The unversioned libdcgm.so linker name creates a normal runtime dependency on the DCGM shared library. Alternatively, an application can link libdcgm_stub.a. The stub is a static forwarding library, not a statically linked copy of DCGM: it uses dlopen() at runtime to load libdcgm.so.4 and forwards calls to the corresponding symbols.

Link libdl when using the stub:

$ gcc foo.c -o foo -ldcgm_stub -ldl

The runtime library must still be installed and discoverable by the dynamic loader. See shared-library loading for the Linux search-path behavior.

REFERENCE SECTIONS#