Skip to content

Nsight NIC plugin fails with -Wextra -Werror due to partially initialized nvtxPayloadSchemaEntry_t #1061

Description

@GregoryKimball

When KvikIO is built as a dependency of a project that enables -Wextra, the Nsight NIC plugin fails because two nvtxPayloadSchemaEntry_t instances omit several fields.

KvikIO adds -Werror to this target, so the warnings become errors:

error: missing initializer for member ‘nvtxPayloadSchemaEntry_v1::flags’
error: missing initializer for member ‘nvtxPayloadSchemaEntry_v1::arrayOrUnionDetail’
error: missing initializer for member ‘nvtxPayloadSchemaEntry_v1::semantics’
error: missing initializer for member ‘nvtxPayloadSchemaEntry_v1::reserved’
[-Werror=missing-field-initializers]

Environment:

  • CUDA 13.1
  • GCC 14
  • Nsight Systems CLI 2026.3.1
  • KvikIO commit 496acd8
  • The same initializer remains on current KvikIO main
  • Consumer compiler flags: -Wextra
  • Plugin compiler flags: -Wall -Werror

Expected fix:

Value-initialize each nvtxPayloadSchemaEntry_t and assign the required fields, or explicitly initialize the remaining fields to zero/null. Value initialization followed by assignment is preferable because it remains safe if NVTX adds more fields later.

Proposed fix in cpp/nsys_plugins/nic/kvikio_nic_nsys_plugin.cpp:

auto make_entry = [](char const* name, char const* description, std::size_t offset) {
  nvtxPayloadSchemaEntry_t entry{};
  entry.type        = NVTX_PAYLOAD_ENTRY_TYPE_DOUBLE;
  entry.name        = name;
  entry.description = description;
  entry.offset      = offset;
  return entry;
};
std::array const entries = {
  make_entry("rx", "Receive rate", offsetof(NicRates, rx)),
  make_entry("tx", "Transmit rate", offsetof(NicRates, tx)),
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions