diff --git a/recipes/holoscan/build.sh b/recipes/holoscan/build.sh new file mode 100644 index 0000000000000..5befa6f2ffaa7 --- /dev/null +++ b/recipes/holoscan/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e +set -x + +# Create the site-packages dir if it doesn't exist +mkdir -p $SP_DIR + +echo "site-packages dir, SP_DIR = $SP_DIR" + +check-glibc bin/* lib/* lib/ucx/* lib/gxf_extensions/* +find python/ -name "*.so*" | xargs -I"{}" check-glibc "{}" + +cp -rv bin $PREFIX/ +cp -rv examples $PREFIX/ +cp -rv lib $PREFIX/ +cp -rv include $PREFIX/ +cp -rv python/lib/* $SP_DIR/ diff --git a/recipes/holoscan/compile_examples.sh b/recipes/holoscan/compile_examples.sh new file mode 100644 index 0000000000000..73f5e1c322fbc --- /dev/null +++ b/recipes/holoscan/compile_examples.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +set -ex + +[[ ${target_platform} == "linux-64" ]] && targetsDir="targets/x86_64-linux" +# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html?highlight=tegra#cross-compilation +[[ ${target_platform} == "linux-aarch64" && ${arm_variant_type} == "sbsa" ]] && targetsDir="targets/sbsa-linux" +[[ ${target_platform} == "linux-aarch64" && ${arm_variant_type} == "tegra" ]] && targetsDir="targets/aarch64-linux" + +if [ -z "${targetsDir+x}" ]; then + echo "target_platform: ${target_platform} is unknown! targetsDir must be defined!" >&2 + exit 1 +fi + +# E.g. $CONDA_PREFIX/libexec/gcc/x86_64-conda-linux-gnu/13.3.0/cc1plus +find $CONDA_PREFIX -name cc1plus + +GCC_DIR=$(dirname $(find $CONDA_PREFIX -name cc1plus)) + +export PATH=${GCC_DIR}:$PATH +export LD_LIBRARY_PATH=${GCC_DIR}:$LD_LIBRARY_PATH + +# No need for use-linker-plugin optimization, causes compile failure, don't use it for the test +export CXXFLAGS="${CXXFLAGS} -fno-use-linker-plugin" + +echo CC = $CC +echo CXX = $CXX + +CMAKE_ARGS="-DCMAKE_LIBRARY_PATH=${GCC_DIR} \ + -DCMAKE_C_COMPILER=$CC \ + -DCMAKE_CXX_COMPILER=$CXX \ + -DCUDAToolkit_INCLUDE_DIRECTORIES=\"$PREFIX/include;$PREFIX/${targetsDir}/include\" \ + -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ + -DCMAKE_CUDA_COMPILER=$PREFIX/bin/nvcc \ + -DCUDAToolkit_ROOT=$PREFIX" + +cmake -S $PREFIX/examples ${CMAKE_ARGS} + +cmake --build . diff --git a/recipes/holoscan/conda_build_config.yaml b/recipes/holoscan/conda_build_config.yaml new file mode 100644 index 0000000000000..5d05845883b47 --- /dev/null +++ b/recipes/holoscan/conda_build_config.yaml @@ -0,0 +1,2 @@ +c_stdlib_version: # [linux] + - 2.34 # [linux] diff --git a/recipes/holoscan/meta.yaml b/recipes/holoscan/meta.yaml new file mode 100644 index 0000000000000..c3f9a17ace61a --- /dev/null +++ b/recipes/holoscan/meta.yaml @@ -0,0 +1,370 @@ +{% set version = "3.0.0.7" %} +{% set python_version = "3.10" %} # holoscan python libs compiled for python 3.10 +{% set cuda_version = "12.6" %} # min version holoscan works with +{% set platform = "linux-x86_64" %} # [linux64] +{% set platform = "linux-sbsa" %} # [aarch64] +{% set extension = "tar.xz" %} + +{% set sha256 = "e0f38b5e74c61f0a9974460dd3947b102519d5e5db18c5fade610491b1ccd012" %} # [linux64] +{% set sha256 = "" %} # [aarch64] + +package: + name: holoscan-split + version: {{ version }} + +source: + url: holoscan-linux-x86_64-3.0.0.7-archive.tar.xz # [linux64] + sha256: {{ sha256 }} + +build: + number: 0 + skip: true # [not (linux64 or aarch64)] + skip: true # [cuda_compiler_version in (None, "None", "") or (cuda_compiler_version or "").startswith("11")] + +requirements: + build: + - cf-nvidia-tools 1 # [linux] + - python ={{ python_version }} + +outputs: + - name: libholoscan + build: + missing_dso_whitelist: + - "*libcuda.so*" # driver + - "*libgdrapi.so*" # part of gdrcopy yet not pre-built for conda-forge channel + - "*libnvidia-ml.so*" # driver + - "*libnvinfer_plugin.so*" # NVIDIA's TensorRT not on conda-forge + - "*libnvonnxparser.so*" # NVIDIA's TensorRT not on conda-forge + - "*libonnxruntime.so.1.18.1" # onnxruntime conda package is there, but this particular version does not have this DSO + - "*libtorchvision.so*" # not available even in torchvision package + - "*libv4l2.so*" # lideo4linux2 lib, not available + - "*libxpmem.so*" # XPMEM, Linux Cross-Memory Attach kernel module, not available + ignore_run_exports_from: + - {{ compiler('cuda') }} + - libnpp-dev # libnpp is tied to specific cuda-version at x.x, so relax it, as we support cuda-version >= 12.6, < 13 + files: + - lib/libholoscan*.so.* + - lib/gxf_extensions + - lib/libgxf*.so + - lib/libucm*.so.* + - lib/libucp*.so.* + - lib/libucs*.so.* + - lib/libuct*.so.* + - lib/libyaml*.so.* + - lib/ucx/*.so.* + - lib/libholo*.a + requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - {{ compiler('cuda') }} + - {{ stdlib("c") }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + host: + - cuda-cudart-dev + - cuda-version {{ cuda_version }} + - libjpeg-turbo + - libnpp-dev + - libtorch + - libvulkan-loader + - rdma-core + run: + - {{ pin_compatible("cuda-version", max_pin="x") }} # [cuda_compiler_version != "None"] + - cloudpickle + - cuda-nvrtc # needed on its own as libs depend on it + - cuda-nvrtc-dev # holoscan wants to explicitly install cuda-nvrtc-dev + - cuda-nvtx # needed to fix broken symlinks: libnvToolsExt.so.1.0.0 -> ../targets/x86_64-linux/lib/libnvToolsExt.so.1.0.0 + - cudnn + - libegl + - libgomp + - libcublas + - libcufft + - libcurand + - libcusolver + - libcusparse + - libjpeg-turbo + - libnpp # needed on its own as libs depend on it + - libnpp-dev # holoscan wants to explicitly install libnpp-dev + - libnvjitlink + - libvulkan-loader + - libzlib + - nccl + - pip + - python ={{ python_version }} # be explicit about python version as holoscan python libs are compiled for given version + - pytorch + - rdma-core + run_constrained: + - arm-variant * {{ arm_variant_type }} # [aarch64] + test: + commands: + - test -L $PREFIX/lib/libholoscan_core.so.3 + - test -L $PREFIX/lib/libholoscan_infer.so.3 + - test -L $PREFIX/lib/libholoscan_infer_onnx_runtime.so.3 + - test -L $PREFIX/lib/libholoscan_infer_torch.so.3 + - test -L $PREFIX/lib/libholoscan_infer_utils.so.3 + - test -L $PREFIX/lib/libholoscan_logger.so.3 + - test -L $PREFIX/lib/libholoscan_op_async_ping_rx.so.3 + - test -L $PREFIX/lib/libholoscan_op_async_ping_tx.so.3 + - test -L $PREFIX/lib/libholoscan_op_bayer_demosaic.so.3 + - test -L $PREFIX/lib/libholoscan_op_format_converter.so.3 + - test -L $PREFIX/lib/libholoscan_op_gxf_codelet.so.3 + - test -L $PREFIX/lib/libholoscan_op_holoviz.so.3 + - test -L $PREFIX/lib/libholoscan_op_inference.so.3 + - test -L $PREFIX/lib/libholoscan_op_inference_processor.so.3 + - test -L $PREFIX/lib/libholoscan_op_ping_rx.so.3 + - test -L $PREFIX/lib/libholoscan_op_ping_tensor_rx.so.3 + - test -L $PREFIX/lib/libholoscan_op_ping_tensor_tx.so.3 + - test -L $PREFIX/lib/libholoscan_op_ping_tx.so.3 + - test -L $PREFIX/lib/libholoscan_op_segmentation_postprocessor.so.3 + - test -L $PREFIX/lib/libholoscan_op_v4l2.so.3 + - test -L $PREFIX/lib/libholoscan_op_video_stream_recorder.so.3 + - test -L $PREFIX/lib/libholoscan_op_video_stream_replayer.so.3 + - test -L $PREFIX/lib/libholoscan_profiler.so.3 + - test -L $PREFIX/lib/libholoscan_spdlog_logger.so.3 + - test -L $PREFIX/lib/libholoscan_viz.so.3 + - test -f $PREFIX/lib/libholoscan_core.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_infer.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_infer_onnx_runtime.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_infer_torch.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_infer_utils.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_logger.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_async_ping_rx.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_async_ping_tx.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_bayer_demosaic.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_format_converter.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_gxf_codelet.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_holoviz.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_inference.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_inference_processor.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_ping_rx.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_ping_tensor_rx.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_ping_tensor_tx.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_ping_tx.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_segmentation_postprocessor.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_v4l2.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_video_stream_recorder.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_op_video_stream_replayer.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_profiler.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_spdlog_logger.so.3.0.0 + - test -f $PREFIX/lib/libholoscan_viz.so.3.0.0 + - test -f $PREFIX/lib/libgxf_app.so + - test -f $PREFIX/lib/libgxf_core.so + - test -f $PREFIX/lib/libgxf_cuda.so + - test -f $PREFIX/lib/libgxf_logger.so + - test -f $PREFIX/lib/libgxf_multimedia.so + - test -f $PREFIX/lib/libgxf_rmm.so + - test -f $PREFIX/lib/libgxf_sample.so + - test -f $PREFIX/lib/libgxf_serialization.so + - test -f $PREFIX/lib/libgxf_std.so + - test -f $PREFIX/lib/libgxf_ucx.so + - test -L $PREFIX/lib/ucx/libucm_cuda.so.0 + - test -L $PREFIX/lib/ucx/libucs_fuse.so.0 + - test -L $PREFIX/lib/ucx/libuct_cma.so.0 + - test -L $PREFIX/lib/ucx/libuct_cuda.so.0 + - test -L $PREFIX/lib/ucx/libuct_cuda_gdrcopy.so.0 + - test -L $PREFIX/lib/ucx/libuct_ib.so.0 + - test -L $PREFIX/lib/ucx/libuct_rdmacm.so.0 + - test -L $PREFIX/lib/ucx/libuct_xpmem.so.0 + - test -L $PREFIX/lib/ucx/libucx_perftest_cuda.so.0 + - test -f $PREFIX/lib/ucx/libucm_cuda.so.0.0.0 + - test -f $PREFIX/lib/ucx/libucs_fuse.so.0.0.0 + - test -f $PREFIX/lib/ucx/libuct_cma.so.0.0.0 + - test -f $PREFIX/lib/ucx/libuct_cuda.so.0.0.0 + - test -f $PREFIX/lib/ucx/libuct_cuda_gdrcopy.so.0.0.0 + - test -f $PREFIX/lib/ucx/libuct_ib.so.0.0.0 + - test -f $PREFIX/lib/ucx/libuct_rdmacm.so.0.0.0 + - test -f $PREFIX/lib/ucx/libuct_xpmem.so.0.0.0 + - test -f $PREFIX/lib/ucx/libucx_perftest_cuda.so.0.0.0 + - test -f $PREFIX/lib/gxf_extensions/libgxf_holoscan_wrapper.so + - test -f $PREFIX/lib/gxf_extensions/libgxf_holoscan_wrapper_lib.so + - test -f $PREFIX/lib/gxf_extensions/libgxf_ucx_holoscan.so + - test -f $PREFIX/lib/gxf_extensions/libgxf_ucx_holoscan_lib.so + - test -L $PREFIX/lib/libyaml-cpp.so.0.7 + - test -f $PREFIX/lib/libyaml-cpp.so.0.7.0 + - test -f $PREFIX/lib/libholoviz_imgui.a + + - name: holoscan + build: + run_exports: + - {{ pin_subpackage("libholoscan", max_pin="x") }} + files: + - lib/python{{ python_version }}/site-packages/gxf + - lib/python{{ python_version }}/site-packages/holoscan + requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - {{ stdlib("c") }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + host: + - {{ pin_subpackage("libholoscan", exact=True) }} + - cuda-version {{ cuda_version }} + - python ={{ python_version }} + run: + - {{ pin_subpackage("libholoscan", exact=True) }} + - cuda-cudart + - python ={{ python_version }} + run_constrained: + - arm-variant * {{ arm_variant_type }} # [aarch64] + test: + commands: + - test -d $PREFIX/lib/python{{ python_version }}/site-packages/gxf + - test -d $PREFIX/lib/python{{ python_version }}/site-packages/holoscan + + - name: libholoscan-dev + build: + missing_dso_whitelist: + - "*libgxf_app.so" # Packaged in libholoscan lib, but referened by examples/** here + - "*libgxf_core.so" # Packaged in libholoscan lib, but referened by examples/** here + - "*libgxf_holoscan_wrapper_lib.so" # Packaged in libholoscan lib, but referened by examples/** here + - "*libgxf_multimedia.so" # Packaged in libholoscan lib, but referened by examples/** here + - "*libgxf_rmm.so" # Packaged in libholoscan lib, but referened by examples/** here + - "*libgxf_std.so" # Packaged in libholoscan lib, but referened by examples/** here + - "*libgxf_sample.so" # Packaged in libholoscan lib, but referened by examples/** here + - "*libgxf_serialization.so" # Packaged in libholoscan lib, but referened by examples/** here + - "*libgxf_ucx.so" # Packaged in libholoscan lib, but referened by examples/** here + - "*libholoscan_*.so.3" # Packaged in libholoscan lib, but referened by python/** here + - "*libyaml-cpp.so.0.7" # Packaged in libholoscan lib, but referened by python/** here + run_exports: + - {{ pin_subpackage("libholoscan", max_pin="x") }} + files: + - bin/README.md + - bin/convert_gxf_entities_to_images.py + - bin/convert_gxf_entities_to_video.py + - bin/convert_video_to_gxf_entities.py + - bin/ctest_time_comparison.py + - bin/download_ngc_data + - bin/generate_extension_uuids.py + - bin/generate_gxf_manifest.py + - bin/graph_surgeon.py + - bin/gxe + - bin/gxf_entity_codec.py + - bin/holoscan + - bin/video_validation.py + - examples/ + - include/3rdparty + - include/fmt + - include/gxf + - include/gxf_holoscan_wrapper + - include/holoinfer + - include/holoscan + - include/holoviz + - include/magic_enum.hpp + - include/rmm + - include/yaml-cpp + - lib/libholoscan*.so + - lib/cmake + - lib/libucm*.so + - lib/libucp*.so + - lib/libucs*.so + - lib/libuct*.so + - lib/libyaml*.so + - lib/ucx/*.so + requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - {{ stdlib("c") }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + host: + - cuda-cudart-dev + - cuda-version {{ cuda_version }} + run: + - {{ pin_subpackage("libholoscan", exact=True) }} + run_constrained: + - arm-variant * {{ arm_variant_type }} # [aarch64] + test: + requires: + - cmake + - make + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - {{ stdlib("c") }} + - cuda-version {{ cuda_version }} + - cuda # need entire CTK to compile all examples + - patch # needed by one of the examples + files: + - compile_examples.sh + commands: + - test -f $PREFIX/bin/README.md + - test -f $PREFIX/bin/convert_gxf_entities_to_images.py + - test -f $PREFIX/bin/convert_gxf_entities_to_video.py + - test -f $PREFIX/bin/convert_video_to_gxf_entities.py + - test -f $PREFIX/bin/ctest_time_comparison.py + - test -f $PREFIX/bin/download_ngc_data + - test -f $PREFIX/bin/generate_extension_uuids.py + - test -f $PREFIX/bin/generate_gxf_manifest.py + - test -f $PREFIX/bin/graph_surgeon.py + - test -f $PREFIX/bin/gxe + - test -f $PREFIX/bin/gxf_entity_codec.py + - test -f $PREFIX/bin/holoscan + - test -f $PREFIX/bin/video_validation.py + - test -d $PREFIX/lib/cmake/holoscan + - test -d $PREFIX/examples + - test -d $PREFIX/include/3rdparty + - test -d $PREFIX/include/fmt + - test -d $PREFIX/include/gxf + - test -d $PREFIX/include/gxf_holoscan_wrapper + - test -d $PREFIX/include/holoinfer + - test -d $PREFIX/include/holoscan + - test -d $PREFIX/include/holoviz + - test -f $PREFIX/include/magic_enum.hpp + - test -d $PREFIX/include/rmm + - test -d $PREFIX/include/yaml-cpp + - test -L $PREFIX/lib/libholoscan_core.so + - test -L $PREFIX/lib/libholoscan_infer.so + - test -L $PREFIX/lib/libholoscan_infer_onnx_runtime.so + - test -L $PREFIX/lib/libholoscan_infer_torch.so + - test -L $PREFIX/lib/libholoscan_infer_utils.so + - test -L $PREFIX/lib/libholoscan_logger.so + - test -L $PREFIX/lib/libholoscan_op_async_ping_rx.so + - test -L $PREFIX/lib/libholoscan_op_async_ping_tx.so + - test -L $PREFIX/lib/libholoscan_op_bayer_demosaic.so + - test -L $PREFIX/lib/libholoscan_op_format_converter.so + - test -L $PREFIX/lib/libholoscan_op_gxf_codelet.so + - test -L $PREFIX/lib/libholoscan_op_holoviz.so + - test -L $PREFIX/lib/libholoscan_op_inference.so + - test -L $PREFIX/lib/libholoscan_op_inference_processor.so + - test -L $PREFIX/lib/libholoscan_op_ping_rx.so + - test -L $PREFIX/lib/libholoscan_op_ping_tensor_rx.so + - test -L $PREFIX/lib/libholoscan_op_ping_tensor_tx.so + - test -L $PREFIX/lib/libholoscan_op_ping_tx.so + - test -L $PREFIX/lib/libholoscan_op_segmentation_postprocessor.so + - test -L $PREFIX/lib/libholoscan_op_v4l2.so + - test -L $PREFIX/lib/libholoscan_op_video_stream_recorder.so + - test -L $PREFIX/lib/libholoscan_op_video_stream_replayer.so + - test -L $PREFIX/lib/libholoscan_profiler.so + - test -L $PREFIX/lib/libholoscan_spdlog_logger.so + - test -L $PREFIX/lib/libholoscan_viz.so + - test -L $PREFIX/lib/libucm.so + - test -L $PREFIX/lib/libucp.so + - test -L $PREFIX/lib/libucs.so + - test -L $PREFIX/lib/libucs_signal.so + - test -L $PREFIX/lib/libuct.so + - test -L $PREFIX/lib/libyaml-cpp.so + - test -L $PREFIX/lib/ucx/libucm_cuda.so + - test -L $PREFIX/lib/ucx/libucs_fuse.so + - test -L $PREFIX/lib/ucx/libuct_cma.so + - test -L $PREFIX/lib/ucx/libuct_cuda.so + - test -L $PREFIX/lib/ucx/libuct_cuda_gdrcopy.so + - test -L $PREFIX/lib/ucx/libuct_ib.so + - test -L $PREFIX/lib/ucx/libuct_rdmacm.so + - test -L $PREFIX/lib/ucx/libuct_xpmem.so + - test -L $PREFIX/lib/ucx/libucx_perftest_cuda.so + - bash compile_examples.sh + +about: + home: https://docs.nvidia.com/cuda/holoscan/ + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_file: LICENSE + license_url: https://developer.download.nvidia.com/assets/Clara/NVIDIA_Clara_EULA.pdf + summary: NVIDIA Holoscan is the AI sensor processing platform that combines hardware systems for low-latency sensor and network connectivity, optimized libraries for data processing and AI, and core microservices to run streaming, imaging, and other applications, from embedded to edge to cloud. + description: | + NVIDIA Holoscan is the AI sensor processing platform that combines hardware systems for low-latency sensor and network connectivity, optimized libraries for data processing and AI, and core microservices to run streaming, imaging, and other applications, from embedded to edge to cloud. + It can be used to build streaming AI pipelines for a variety of domains, including Medical Devices, High Performance Computing at the Edge, Industrial Inspection and more. + doc_url: https://docs.nvidia.com/cuda/holoscan/ + +extra: + recipe-maintainers: + - conda-forge/cuda + feedstock-name: holoscan