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

Add cuda-cupti recipe #22355

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

move lib\* %LIBRARY_LIB%
move include\* %LIBRARY_INC%
move doc %PREFIX%
move samples %PREFIX%
30 changes: 30 additions & 0 deletions recipes/cuda-cupti/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Install to conda style directories
[[ -d lib64 ]] && mv lib64 lib
mkdir -p ${PREFIX}/lib
[[ ${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-cupti/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arm_variant_type: # [aarch64]
- sbsa # [aarch64]
177 changes: 177 additions & 0 deletions recipes/cuda-cupti/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
{% set name = "cuda-cupti" %}
{% set version = "12.0.90" %}
adibbley marked this conversation as resolved.
Show resolved Hide resolved
{% set lib_version = "2022.4.0" %}
{% 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_cupti/{{ platform }}/cuda_cupti-{{ platform }}-{{ version }}-archive.{{ extension }}
sha256: 3c93a6a8c5eab3a56c1a0a514c0ac7d374807c70a9551155f089588b6c5e1d10 # [linux64]
sha256: bbabb508eb4fb0f9d98ac3ab4a40d0278de41cef95139c1bfe6436b716dd6cfc # [ppc64le]
sha256: 33b3b06cf9838fa3289c7e40f143a8f58b941ccad93f9d0640a29bb83aa2152e # [aarch64]
sha256: b65a34a3715e3ef2b835bdd36c43b21c20800325be1eda1e84ad4d80ee837c92 # [win]

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

test:
commands:
- test -L $PREFIX/lib/libcupti.so.{{ version.split(".")[0] }} # [linux]
- test -L $PREFIX/lib/libcupti.so.{{ lib_version }} # [linux]
- test -L $PREFIX/targets/{{ target_name }}/lib/libcupti.so.{{ version.split(".")[0] }} # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/libcupti.so.{{ lib_version }} # [linux]
- if not exist %LIBRARY_LIB%\cupti64_{{ lib_version }}.dll exit 1 # [win]

outputs:
- name: cuda-cupti
files:
- lib/libcupti*.so.* # [linux]
adibbley marked this conversation as resolved.
Show resolved Hide resolved
- targets/{{ target_name }}/lib/*.so.* # [linux]
- Library\lib\*.dll # [win]
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: Provides libraries to enable third party tools using GPU profiling APIs.
description: |
Provides libraries to enable third party tools using GPU profiling APIs.
doc_url: https://docs.nvidia.com/cuda/cupti/index.html

- name: cuda-cupti-dev
files:
- lib/checkpoint.so # [linux]
- lib/libcupti.so # [linux]
- lib/libnv*.so # [linux]
- lib/libpcsamplingutil.so # [linux]
- targets/{{ target_name }}/lib/*.so # [linux]
- targets/{{ target_name }}/include # [linux]
- Library\include # [win]
- Library\lib\*.lib # [win]
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") }}
- {{ pin_subpackage("cuda-cupti", exact=True) }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
adibbley marked this conversation as resolved.
Show resolved Hide resolved
- cuda-cupti-static >={{ version }}
test:
commands:
- test -L $PREFIX/lib/libcupti.so # [linux]
- test -L $PREFIX/lib/libnvperf_host.so # [linux]
- test -L $PREFIX/lib/libnvperf_target.so # [linux]
- test -f $PREFIX/targets/{{ target_name }}/include/cupti.h # [linux]
kkraus14 marked this conversation as resolved.
Show resolved Hide resolved
- test -L $PREFIX/targets/{{ target_name }}/lib/libcupti.so # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/libnvperf_host.so # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/libnvperf_target.so # [linux]
- if not exist %LIBRARY_LIB%\cupti.lib exit 1 # [win]
- if not exist %LIBRARY_INC%\cupti.h exit 1 # [win]
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: Provides libraries to enable third party tools using GPU profiling APIs.
description: |
Provides libraries to enable third party tools using GPU profiling APIs.
doc_url: https://docs.nvidia.com/cuda/cupti/index.html

- name: cuda-cupti-static
build:
skip: True # [not linux]
adibbley marked this conversation as resolved.
Show resolved Hide resolved
files:
- targets/{{ target_name }}/lib/*static.a
requirements:
build:
- 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]
test:
commands:
- test -f $PREFIX/targets/{{ target_name }}/lib/libcupti_static.a # [linux]
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: Provides libraries to enable third party tools using GPU profiling APIs.
description: |
Provides libraries to enable third party tools using GPU profiling APIs.
doc_url: https://docs.nvidia.com/cuda/cupti/index.html

- name: cuda-cupti-doc
files:
- targets/{{ target_name }}/{{ name }}/samples
- targets/{{ target_name }}/{{ name }}/doc
requirements:
build:
- 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]
test:
commands:
- test -d $PREFIX/targets/{{ target_name }}/{{ name }}/samples # [linux]
- test -d $PREFIX/targets/{{ target_name }}/{{ name }}/doc # [linux]
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: Provides libraries to enable third party tools using GPU profiling APIs.
description: |
Provides libraries to enable third party tools using GPU profiling APIs.
doc_url: https://docs.nvidia.com/cuda/cupti/index.html

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: Provides libraries to enable third party tools using GPU profiling APIs.
description: |
Provides libraries to enable third party tools using GPU profiling APIs.
doc_url: https://docs.nvidia.com/cuda/cupti/index.html

extra:
recipe-maintainers:
- adibbley