Skip to content

Commit c4c1c0b

Browse files
tstamlerdfarge
andauthored
POSIX: merge posix plugin to main with CI changes (#234)
* NIXL POSIX plugin (#178) * Added status.h header, containing useful macros for checking nixl_status_t * CI: test liburing install and run posix_test Signed-off-by: Timothy Stamler <tstamler@nvidia.com> Co-authored-by: dfarge <dfarge@nvidia.com>
1 parent 3491e36 commit c4c1c0b

18 files changed

+1190
-2
lines changed

.gitlab/build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ apt-get -qq install -y curl \
5353
libgrpc-dev \
5454
libgrpc++-dev \
5555
libprotobuf-dev \
56+
liburing-dev \
5657
meson \
5758
ninja-build \
5859
pkg-config \

.gitlab/test_cpp.sh

+4
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ env
4141
nvidia-smi topo -m || true
4242
ibv_devinfo || true
4343

44+
apt-get -qq update
45+
apt-get -qq install liburing-dev
46+
4447
echo "==== Running C++ tests ===="
4548
cd ${INSTALL_DIR}
4649
./bin/desc_example
4750
./bin/agent_example
4851
./bin/nixl_example
4952
./bin/ucx_backend_test
5053
./bin/ucx_mo_backend_test
54+
./bin/nixl_posix_test
5155
./bin/ucx_backend_multi
5256
./bin/serdes_test
5357
./bin/gtest

.gitlab/test_python.sh

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ if [ -z "$INSTALL_DIR" ]; then
2525
exit 1
2626
fi
2727

28+
apt-get -qq install liburing-dev
29+
2830
export LD_LIBRARY_PATH=${INSTALL_DIR}/lib:${INSTALL_DIR}/lib/x86_64-linux-gnu:${INSTALL_DIR}/lib/x86_64-linux-gnu/plugins:/usr/local/lib:$LD_LIBRARY_PATH
2931
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:/usr/local/cuda/lib64:/usr/local/cuda-12.8/compat:$LD_LIBRARY_PATH
3032
export LD_LIBRARY_PATH=/usr/local/cuda/compat/lib.real:$LD_LIBRARY_PATH

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ pip install nixl
3535
### Ubuntu:
3636

3737
`$ sudo apt install build-essential cmake pkg-config`
38+
`$ sudo apt install liburing-dev`
3839

3940
### Fedora:
4041

4142
`$ sudo dnf install gcc-c++ cmake pkg-config`
43+
`$ sudo dnf install liburing-devel`
4244

4345
### Python
4446

contrib/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ RUN git clone https://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3.git &&\
4040
cd etcd-cpp-apiv3 && mkdir build && cd build && \
4141
cmake .. && make -j$(nproc) && make install
4242

43+
RUN apt install liburing-dev
44+
4345
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
4446

4547
ENV RUSTUP_HOME=/usr/local/rustup \

src/core/nixl_plugin_manager.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -387,5 +387,10 @@ void nixlPluginManager::registerBuiltinPlugins() {
387387
extern nixlBackendPlugin* createStaticGdsPlugin();
388388
registerStaticPlugin("GDS", createStaticGdsPlugin);
389389
#endif
390+
391+
#ifdef STATIC_PLUGIN_POSIX
392+
extern nixlBackendPlugin* createStaticPosixPlugin();
393+
registerStaticPlugin("POSIX", createStaticPosixPlugin);
394+
#endif
390395
#endif
391396
}

src/plugins/meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ucx_backend_inc_dirs = include_directories('./ucx')
1717

1818
subdir('ucx')
1919
subdir('ucx_mo')
20+
subdir('posix')
2021

2122
disable_gds_backend = get_option('disable_gds_backend')
2223
if not disable_gds_backend and cuda_dep.found()

src/plugins/posix/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
SPDX-License-Identifier: Apache-2.0
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
# NIXL POSIX Plugin
19+
20+
This plugin uses liburing as an I/O backend for NIXL.
21+
22+
# Install
23+
sudo apt install liburing-dev

src/plugins/posix/meson.build

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Check for liburing dependency
17+
liburing_dep = dependency('liburing', required: true)
18+
19+
# Get Abseil dependencies
20+
absl_log_dep = dependency('absl_log', required: true)
21+
22+
if 'POSIX' in static_plugins
23+
posix_backend_lib = static_library('POSIX', 'posix_backend.cpp', 'posix_backend.h', 'posix_plugin.cpp',
24+
dependencies: [nixl_infra, liburing_dep, absl_log_dep],
25+
link_args: ['-luring'],
26+
include_directories: [nixl_inc_dirs, utils_inc_dirs],
27+
install: false,
28+
cpp_args: compile_flags,
29+
name_prefix: 'libplugin_') # Custom prefix for plugin libraries
30+
else
31+
posix_backend_lib = shared_library('POSIX', 'posix_backend.cpp', 'posix_backend.h', 'posix_plugin.cpp',
32+
dependencies: [nixl_infra, liburing_dep, absl_log_dep],
33+
include_directories: [nixl_inc_dirs, utils_inc_dirs],
34+
link_args: ['-luring'],
35+
install: true,
36+
cpp_args: ['-fPIC'],
37+
name_prefix: 'libplugin_', # Custom prefix for plugin libraries
38+
install_dir: plugin_install_dir)
39+
if get_option('buildtype') == 'debug'
40+
run_command('sh', '-c',
41+
'echo "POSIX=' + posix_backend_lib.full_path() + '" >> ' + plugin_build_dir + '/pluginlist',
42+
check: true
43+
)
44+
endif
45+
endif
46+
47+
posix_backend_interface = declare_dependency(link_with: posix_backend_lib)

0 commit comments

Comments
 (0)