Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding cuda-nvtx recipe #22052

Merged
merged 18 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from 14 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
5 changes: 5 additions & 0 deletions recipes/cuda-nvtx/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if not exist %PREFIX% mkdir %PREFIX%
mkdir %LIBRARY_INC%\targets
mkdir %LIBRARY_INC%\targets\x64

move include\nvtx3 %LIBRARY_INC%\targets\x64
33 changes: 33 additions & 0 deletions recipes/cuda-nvtx/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Install to conda style directories
[[ -d lib64 ]] && mv lib64 lib
mkdir -p ${PREFIX}/lib
[[ -d pkg-config ]] && mkdir -p ${PREFIX}/lib && mv pkg-config ${PREFIX}/lib/pkgconfig
[[ -d "$PREFIX/lib/pkgconfig" ]] && sed -E -i "s|cudaroot=.+|cudaroot=$PREFIX|g" $PREFIX/lib/pkgconfig/nvToolsExt*.pc

[[ ${target_platform} == "linux-64" ]] && targetsDir="targets/x86_64-linux"
[[ ${target_platform} == "linux-ppc64le" ]] && targetsDir="targets/ppc64le-linux"
[[ ${target_platform} == "linux-aarch64" ]] && targetsDir="targets/sbsa-linux"

for i in `ls`; do
[[ $i == "build_env_setup.sh" ]] && continue
[[ $i == "conda_build.sh" ]] && continue
[[ $i == "metadata_conda_debug.yaml" ]] && continue
if [[ $i == "lib" ]] || [[ $i == "include" ]]; then
# Headers and libraries are installed to targetsDir
mkdir -p ${PREFIX}/${targetsDir}
mkdir -p ${PREFIX}/$i
cp -rv $i ${PREFIX}/${targetsDir}
if [[ $i == "lib" ]]; then
for j in "$i"/*.so*; do
# Shared libraries are symlinked in $PREFIX/lib
ln -s ${PREFIX}/${targetsDir}/$j ${PREFIX}/$j
done
fi
else
# Put all other files in targetsDir
mkdir -p ${PREFIX}/${targetsDir}/${PKG_NAME}
cp -rv $i ${PREFIX}/${targetsDir}/${PKG_NAME}
fi
done
2 changes: 2 additions & 0 deletions recipes/cuda-nvtx/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arm_variant_type: # [aarch64]
- sbsa # [aarch64]
121 changes: 121 additions & 0 deletions recipes/cuda-nvtx/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{% set name = "cuda-nvtx" %}
{% set version = "12.0.76" %}
adibbley marked this conversation as resolved.
Show resolved Hide resolved
{% set cuda_version = "12.0" %}
{% set platform = "linux-x86_64" %} # [linux64]
{% set platform = "linux-ppc64le" %} # [ppc64le]
{% set platform = "linux-sbsa" %} # [aarch64]
{% set platform = "windows-x86_64" %} # [win]
{% set target_name = "x86_64-linux" %} # [linux64]
{% set target_name = "ppc64le-linux" %} # [ppc64le]
{% set target_name = "sbsa-linux" %} # [aarch64]
{% set target_name = "x64" %} # [win]
{% set extension = "tar.xz" %} # [not win]
{% set extension = "zip" %} # [win]

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvtx/{{ platform }}/cuda_nvtx-{{ platform }}-{{ version }}-archive.{{ extension }}
sha256: 1d2cbcb05a2e8a04b51a866b6997cb73ed90e61ffa183669d3f9ff7a0c7fd654 # [linux64]
sha256: 2a8aef88030147cd0a394d6fe1ceb2d26aa9694aa751e10d58e39623f27cf7e2 # [ppc64le]
sha256: 2cb31f10cf0e58d296611bac2bb6e2f9ccb498753bb148b487defbd95e11f3e8 # [aarch64]
sha256: e16c1214fb7ae1bb60a9224e07b70aa5fd03310226140672ab3b409ddf4ae2a7 # [win]

build:
number: 0
skip: true # [osx]

test:
commands:
- test -L $PREFIX/lib/libnvToolsExt.so.1 # [linux]
- test -L $PREFIX/lib/libnvToolsExt.so.1.0.0 # [linux]
- test -L $PREFIX/targets/{{ target_name }}/lib/libnvToolsExt.so.1 # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/libnvToolsExt.so.1.0.0 # [linux]

outputs:
- name: cuda-nvtx
adibbley marked this conversation as resolved.
Show resolved Hide resolved
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
files:
- lib/libnv*.so.* # [linux]
- targets/{{ target_name }}/lib/*.so.* # [linux]
Comment on lines +41 to +43
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is a better approach for the clobbering issue on Windows?

Suggested change
files:
- lib/libnv*.so.* # [linux]
- targets/{{ target_name }}/lib/*.so.* # [linux]
files: [] # [win]
files: # [linux]
- lib/libnv*.so.* # [linux]
- targets/{{ target_name }}/lib/*.so.* # [linux]

requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- arm-variant * {{ arm_variant_type }} # [aarch64]
host:
- cuda-version {{ cuda_version }}
run:
- {{ pin_compatible("cuda-version", max_pin="x.x") }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
# Tests are defined at the top level, due to package/output name conflicts.
about:
home: https://developer.nvidia.com/cuda-toolkit
license_file: LICENSE
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: A C-based API for annotating events, code ranges, and resources
description: |
A C-based API for annotating events, code ranges, and resources in your
applications. Applications which integrate NVTX can use the Visual Profiler
to capture and visualize these events and ranges.
doc_url: https://docs.nvidia.com/nvtx/

- name: cuda-nvtx-dev
build:
run_exports:
- {{ pin_subpackage("cuda-nvtx", max_pin='x') }}
files:
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
- lib/libnv*.so # [linux]
- lib/pkgconfig # [linux]
- targets/{{ target_name }}/lib/*.so # [linux]
- targets/{{ target_name }}/include/nvToolsExt*.h # [linux]
- targets/{{ target_name }}/include/nvtx3 # [linux]
- Library\include\targets\{{ target_name }} # [win]
requirements:
build:
- arm-variant * {{ arm_variant_type }} # [aarch64]
host:
- cuda-version {{ cuda_version }}
run:
- {{ pin_compatible("cuda-version", max_pin="x.x") }}
- {{ pin_subpackage("cuda-nvtx", exact=True) }}
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
commands:
- test -L $PREFIX/lib/libnvToolsExt.so # [linux]
- test -f $PREFIX/lib/pkgconfig/nvToolsExt*.pc # [linux]
- test -f $PREFIX/targets/{{ target_name }}/include/nvToolsExtCuda.h # [linux]
- test -f $PREFIX/targets/{{ target_name }}/include/nvtx3/nvToolsExtCuda.h # [linux]
- test -L $PREFIX/targets/{{ target_name }}/lib/libnvToolsExt.so # [linux]
- if not exist Library\include\targets\{{ target_name }}\nvtx3\nvToolsExt.h exit 1 # [win]
about:
home: https://developer.nvidia.com/cuda-toolkit
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
license_file: LICENSE
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: A C-based API for annotating events, code ranges, and resources
description: |
A C-based API for annotating events, code ranges, and resources in your
applications. Applications which integrate NVTX can use the Visual Profiler
to capture and visualize these events and ranges.
doc_url: https://docs.nvidia.com/nvtx/

about:
home: https://developer.nvidia.com/cuda-toolkit
license_file: LICENSE
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: A C-based API for annotating events, code ranges, and resources
description: |
A C-based API for annotating events, code ranges, and resources in your
applications. Applications which integrate NVTX can use the Visual Profiler
to capture and visualize these events and ranges.
doc_url: https://docs.nvidia.com/nvtx/

extra:
recipe-maintainers:
- adibbley