这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
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: 4 additions & 0 deletions recipes/cuda-nvml-dev/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if not exist %PREFIX% mkdir %PREFIX%

move lib\x64\* %LIBRARY_LIB%
move include\* %LIBRARY_INC%
28 changes: 28 additions & 0 deletions recipes/cuda-nvml-dev/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/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/nvidia-ml-*.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}
# Nothing to be symlinked in $PREFIX/lib
# else
# Skip all other files (only samples here)
# mkdir -p ${PREFIX}/${targetsDir}/${PKG_NAME}
# cp -rv $i ${PREFIX}/${targetsDir}/${PKG_NAME}
fi
done
2 changes: 2 additions & 0 deletions recipes/cuda-nvml-dev/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arm_variant_type: # [aarch64]
- sbsa # [aarch64]
62 changes: 62 additions & 0 deletions recipes/cuda-nvml-dev/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{% set name = "cuda-nvml-dev" %}
{% set version = "12.0.76" %}
{% 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_nvml_dev/{{ platform }}/cuda_nvml_dev-{{ platform }}-{{ version }}-archive.{{ extension }}
sha256: 6780e554784bef73050144afe39668e26923d2533c268460c348e0e380d5d048 # [linux64]
sha256: 319b96999d144192094d254f0607debb14118ce206ef7dfeba3d13da1cc805ec # [ppc64le]
sha256: 4aee09e48ecd30b2dcaa9de4eb8af2fcdf36ed040eac50c14f3345a12410b6ec # [aarch64]
sha256: abc366280d0aa1ca047323a3e316270b80ffabb649021184647cd16b44c60a71 # [win]

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

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]

test:
commands:
- test -f $PREFIX/lib/pkgconfig/nvidia-ml-*.pc # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/stubs/libnvidia-ml.so # [linux]
Copy link
Contributor

@bdice bdice Apr 6, 2023

Choose a reason for hiding this comment

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

Where is the non-stub library shipped? (Another package?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a driver file, which we have no conda package for
nvidia_driver-linux-x86_64-525.85.12-archive/lib/libnvidia-ml.so.525.85.12

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. Maybe a comment could help explain that? I wasn't aware.

- test -f $PREFIX/targets/{{ target_name }}/include/nvml.h # [linux]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this land in $PREFIX/include as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We held off on putting symlinks in $PREFIX/include for all packages. IIRC there were concerns with the generic naming of headers, such as math_functions.h and others. Using nvcc will include the targets directory by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough. I think we should prioritize a strategy around this because most of these are host functions where nvcc isn't required and generally shouldn't be used if there's no kernels / device code.

- if not exist %LIBRARY_LIB%\nvml.lib exit 1 # [win]
- if not exist %LIBRARY_INC%\nvml.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: NVML native dev links, headers
description: |
NVML native dev links, headers
doc_url: https://docs.nvidia.com/cuda/index.html

extra:
recipe-maintainers:
- adibbley