Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion conda/recipes/libkvikio/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
schema_version: 1

Expand Down Expand Up @@ -112,6 +112,8 @@ outputs:
tests:
- script:
- test -f $PREFIX/include/kvikio/file_handle.hpp
- test -x $PREFIX/share/kvikio/nsys-plugins/kvikio_nic/kvikio_nic_nsys_plugin
- test -f $PREFIX/share/kvikio/nsys-plugins/kvikio_nic/nsys-plugin.yaml
about:
homepage: ${{ load_from_file("python/libkvikio/pyproject.toml").project.urls.Homepage }}
license: ${{ load_from_file("python/libkvikio/pyproject.toml").project.license }}
Expand Down
10 changes: 9 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# =============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
# =============================================================================
Expand Down Expand Up @@ -52,6 +52,7 @@ option(KvikIO_BUILD_BENCHMARKS "Configure CMake to build benchmarks" OFF)
option(KvikIO_BUILD_EXAMPLES "Configure CMake to build examples" ON)
option(KvikIO_BUILD_TESTS "Configure CMake to build tests" ON)
option(KvikIO_REMOTE_SUPPORT "Configure CMake to build with remote IO support" ON)
option(KvikIO_BUILD_NSYS_PLUGIN "Configure CMake to build the Nsight Systems NIC plugin" ON)

# ##################################################################################################
# * conda environment ------------------------------------------------------------------------------
Expand Down Expand Up @@ -264,6 +265,13 @@ if(KvikIO_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

# ##################################################################################################
# * add Nsight Systems plugin ----------------------------------------------------------------------

if(KvikIO_BUILD_NSYS_PLUGIN)
add_subdirectory(nsys_plugins/nic)
endif()

if(KvikIO_BUILD_TESTS AND CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(cmake/thirdparty/get_gtest.cmake)

Expand Down
40 changes: 40 additions & 0 deletions cpp/nsys_plugins/nic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# =============================================================================
# cmake-format: off
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# cmake-format: on
# =============================================================================

# The plugin is a standalone Nsight Systems collector. It reads NVTX headers only (header-only) and
# libdl, so it deliberately does not link libkvikio and is fully relocatable.
set(NSYS_PLUGIN_INSTALL_DIR share/kvikio/nsys-plugins/kvikio_nic)

# The NIC-reading core (nic_monitor.cpp) is compiled directly into the plugin so it links no shared
# library beyond NVTX (header-only) and libdl.
add_executable(kvikio_nic_nsys_plugin kvikio_nic_nsys_plugin.cpp nic_monitor.cpp)

set_target_properties(
kvikio_nic_nsys_plugin
PROPERTIES CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
INSTALL_RPATH ""
)

target_link_libraries(kvikio_nic_nsys_plugin PRIVATE nvtx3::nvtx3-cpp ${CMAKE_DL_LIBS})

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(
kvikio_nic_nsys_plugin PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-Wall;-Werror;-Wno-unknown-pragmas>"
)
endif()

install(
TARGETS kvikio_nic_nsys_plugin
COMPONENT nsys_plugin
DESTINATION ${NSYS_PLUGIN_INSTALL_DIR}
)
install(
FILES nsys-plugin.yaml
COMPONENT nsys_plugin
DESTINATION ${NSYS_PLUGIN_INSTALL_DIR}
)
Loading