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 libcusolver, libcusparse, and libnvjitlink recipes #21924

Merged
merged 42 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
93834b6
initial check-in (internal commit 624752ec)
leofang Feb 1, 2023
6c8d09a
make cuBLAS a run dependency
leofang Feb 1, 2023
7459d1f
remove static METIS lib
leofang Feb 1, 2023
48f116c
bump cublas dependency; assume libnvjitlink exists
leofang Feb 1, 2023
41fb7fb
initial check-in (internal commit 7a3d3b8d)
leofang Feb 3, 2023
99790c8
cublas & nvjitlink should be run dependencies
leofang Feb 3, 2023
785a33d
add sanity checks for libcusolver
leofang Feb 3, 2023
ae14a0c
no plural
leofang Feb 3, 2023
3c79454
WIP
leofang Feb 6, 2023
083857d
initial checkin of cusparse
leofang Feb 28, 2023
0efd9cb
cusparse links to nvjitlink
leofang Feb 28, 2023
97b6a04
Apply suggestions from code review
leofang Mar 22, 2023
709abef
update to rely on cuda-version
leofang Mar 22, 2023
3e8567a
fix cusparse recipe to pass linter
leofang Mar 22, 2023
1b87dd8
one more linter fix
leofang Mar 22, 2023
8052ae1
Merge branch 'main' into libcusolver
leofang Mar 22, 2023
12a4b33
fix filename
leofang Mar 22, 2023
008ec73
fix for windows
leofang Mar 23, 2023
3ed95cf
suppress win64 linker error on nvjitlink
leofang Mar 23, 2023
fe56040
propagate about to subpackages (libcusolver)
leofang Mar 23, 2023
67fd67a
propagate about to subpackages (libcusparse)
leofang Mar 23, 2023
721ff08
propagate about to subpackages (libnvjitlink)
leofang Mar 23, 2023
92efb58
update libcusolver recipe
leofang Mar 24, 2023
0abb25c
update libcusparse recipe
leofang Mar 24, 2023
42047ff
Merge branch 'main' into libcusolver
jakirkham Mar 27, 2023
6099b39
propagate cublas changes to cusolver
leofang Apr 1, 2023
91436ce
propagate cublas changes to nvjitlink
leofang Apr 1, 2023
0cfc1c2
Merge branch 'main' into libcusolver
leofang Apr 1, 2023
aeea554
fix typo
leofang Apr 1, 2023
5beb9a6
Merge branch 'libcusolver' of https://github.com/leofang/staged-recip…
leofang Apr 1, 2023
305cf50
fix linter
leofang Apr 1, 2023
f8a492c
fix cusolver
leofang Apr 1, 2023
8591f8f
propagate cublas changes to cusparse
leofang Apr 1, 2023
932012d
try fixing win
leofang Apr 1, 2023
d253cb0
fix libcusolver on win
leofang Apr 1, 2023
2b43bd8
avoid pinning too tightly
leofang Apr 1, 2023
677153a
Update recipes/libnvjitlink/meta.yaml
leofang Apr 1, 2023
96f6ad0
test if this WAR is outdated
leofang Apr 2, 2023
d6f084e
Revert "avoid pinning too tightly"
leofang Apr 3, 2023
f564c6d
Apply suggestions from code review
leofang Apr 5, 2023
5cf9dd7
fix linter
leofang Apr 5, 2023
bc7eec9
fix the dependencies of static packages
leofang Apr 5, 2023
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/libcusolver/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if not exist %PREFIX% mkdir %PREFIX%

move lib\x64\* %LIBRARY_LIB%
move bin\* %LIBRARY_BIN%
move include\* %LIBRARY_INC%
33 changes: 33 additions & 0 deletions recipes/libcusolver/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 ]] && mv pkg-config ${PREFIX}/lib/pkgconfig
[[ -d "$PREFIX/lib/pkgconfig" ]] && sed -E -i "s|cudaroot=.+|cudaroot=$PREFIX|g" $PREFIX/lib/pkgconfig/cusolver*.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
leofang marked this conversation as resolved.
Show resolved Hide resolved
# 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/libcusolver/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arm_variant_type: # [aarch64]
- sbsa # [aarch64]
185 changes: 185 additions & 0 deletions recipes/libcusolver/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{% set name = "libcusolver" %}
{% set version = "11.4.2.57" %}
leofang 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/{{ name }}/{{ platform }}/{{ name }}-{{ platform }}-{{ version }}-archive.{{ extension }}
sha256: c9460db500d0c7d14debb2c8e0d88fc26a39197363f1b000ccf760866f636f12 # [linux64]
sha256: bf3c9a090652d011aafe2190c6f26fe108194cf8512d3c571e406054740168bb # [ppc64le]
sha256: 0ca46b73520657f96f921711c05af7053bd398328d510aecddfff2521c000e91 # [aarch64]
sha256: c09836df1f43a3496f2b61ad8827af662ace298508869564a40c30d909ba550f # [win]

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

outputs:
- name: libcusolver
files:
- lib/libcusolver*.so.* # [linux]
- targets/{{ target_name }}/lib/libcusolver*.so.* # [linux]
- Library\bin\cusolver*.dll # [win]
requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- arm-variant * {{ arm_variant_type }} # [aarch64]
- sysroot_{{ target_platform }} 2.17 # [linux]
host:
- cuda-version {{ cuda_version }}
- libcublas
- libnvjitlink
kkraus14 marked this conversation as resolved.
Show resolved Hide resolved
run:
- {{ pin_compatible("cuda-version", max_pin="x.x") }}
- {{ pin_compatible("libcublas", max_pin="x.x") }}
- {{ pin_compatible("libnvjitlink", max_pin="x.x") }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
commands:
- test -L $PREFIX/lib/libcusolver.so.{{ version }} # [linux]
- test -L $PREFIX/lib/libcusolver.so.{{ version.split(".")[0] }} # [linux]
- test -L $PREFIX/targets/{{ target_name }}/lib/libcusolver.so.{{ version }} # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/libcusolver.so.{{ version.split(".")[0] }} # [linux]
- test -L $PREFIX/lib/libcusolverMg.so.{{ version }} # [linux]
- test -L $PREFIX/lib/libcusolverMg.so.{{ version.split(".")[0] }} # [linux]
- test -L $PREFIX/targets/{{ target_name }}/lib/libcusolverMg.so.{{ version }} # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/libcusolverMg.so.{{ version.split(".")[0] }} # [linux]
- if not exist %LIBRARY_BIN%\cusolver*.dll exit 1 # [win]
- if not exist %LIBRARY_BIN%\cusolverMg*.dll exit 1 # [win]
about:
home: https://developer.nvidia.com/cusolver
license_file: LICENSE
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: CUDA Linear Solver Library
description: |
cuSOLVER - Direct Linear Solvers on NVIDIA GPUs
doc_url: https://docs.nvidia.com/cuda/cusolver/

- name: libcusolver-dev
build:
run_exports:
- {{ pin_subpackage("libcusolver", max_pin="x") }}
files:
- lib/libcusolver*.so # [linux]
- lib/pkgconfig # [linux]
- targets/{{ target_name }}/include # [linux]
- targets/{{ target_name }}/lib/libcusolver*.so # [linux]
- targets/{{ target_name }}/lib/stubs # [linux]
# Not shipping Fortran bindings (in src) on Windows for now
- targets/{{ target_name }}/libcusolver/src # [linux]
- Library\include # [win]
- Library\lib # [win]
requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- arm-variant * {{ arm_variant_type }} # [aarch64]
- sysroot_{{ target_platform }} 2.17 # [linux]
host:
- cuda-version {{ cuda_version }}
run:
- {{ pin_compatible("cuda-version", max_pin="x.x") }}
- {{ pin_subpackage("libcusolver", exact=True) }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
- libcusolver-static >={{ version }} # [linux]
test:
commands:
- test -L $PREFIX/lib/libcusolver.so # [linux]
- test -L $PREFIX/lib/libcusolverMg.so # [linux]
- test -f $PREFIX/lib/pkgconfig/cusolver*.pc # [linux]
- test -f $PREFIX/targets/{{ target_name }}/include/cusolverDn.h # [linux]
- test -f $PREFIX/targets/{{ target_name }}/include/cusolverMg.h # [linux]
- test -f $PREFIX/targets/{{ target_name }}/include/cusolverRf.h # [linux]
- test -f $PREFIX/targets/{{ target_name }}/include/cusolverSp.h # [linux]
- test -f $PREFIX/targets/{{ target_name }}/include/cusolverSp_LOWLEVEL_PREVIEW.h # [linux]
- test -f $PREFIX/targets/{{ target_name }}/include/cusolver_common.h # [linux]
- test -L $PREFIX/targets/{{ target_name }}/lib/libcusolver.so # [linux]
- test -L $PREFIX/targets/{{ target_name }}/lib/libcusolverMg.so # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/stubs/libcusolver.so # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/stubs/libcusolverMg.so # [linux]
- if not exist %LIBRARY_INC%\cusolverDn.h exit 1 # [win]
- if not exist %LIBRARY_INC%\cusolverMg.h exit 1 # [win]
- if not exist %LIBRARY_INC%\cusolverRf.h exit 1 # [win]
- if not exist %LIBRARY_INC%\cusolverSp.h exit 1 # [win]
- if not exist %LIBRARY_INC%\cusolverSp_LOWLEVEL_PREVIEW.h exit 1 # [win]
- if not exist %LIBRARY_INC%\cusolver_common.h exit 1 # [win]
- if not exist %LIBRARY_LIB%\cusolver*.lib exit 1 # [win]
- if not exist %LIBRARY_LIB%\cusolverMg*.lib exit 1 # [win]
about:
home: https://developer.nvidia.com/cusolver
license_file: LICENSE
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: CUDA Linear Solver Library
description: |
cuSOLVER - Direct Linear Solvers on NVIDIA GPUs
doc_url: https://docs.nvidia.com/cuda/cusolver/index.html

- name: libcusolver-static
build:
skip: true # [win]
files:
- targets/{{ target_name }}/lib/libcusolver*_static.a
- targets/{{ target_name }}/lib/libmetis_static.a
requirements:
leofang marked this conversation as resolved.
Show resolved Hide resolved
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- arm-variant * {{ arm_variant_type }} # [aarch64]
- sysroot_{{ target_platform }} 2.17 # [linux]
host:
- cuda-version {{ cuda_version }}
- libcublas-static
- libcusparse-static
kkraus14 marked this conversation as resolved.
Show resolved Hide resolved
run:
- {{ pin_compatible("cuda-version", max_pin="x.x") }}
- {{ pin_compatible("libcublas-static", max_pin="x.x") }}
- {{ pin_compatible("libcusparse-static", max_pin="x.x") }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
commands:
- test -f $PREFIX/targets/{{ target_name }}/lib/libcusolver_static.a
- test -f $PREFIX/targets/{{ target_name }}/lib/libcusolver_lapack_static.a
- test -f $PREFIX/targets/{{ target_name }}/lib/libcusolver_metis_static.a
- test -f $PREFIX/targets/{{ target_name }}/lib/libmetis_static.a
about:
home: https://developer.nvidia.com/cusolver
license_file: LICENSE
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: CUDA Linear Solver Library
description: |
cuSOLVER - Direct Linear Solvers on NVIDIA GPUs
doc_url: https://docs.nvidia.com/cuda/cusolver/index.html

about:
home: https://developer.nvidia.com/cusolver
license_file: LICENSE
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: CUDA Linear Solver Library
description: |
cuSOLVER - Direct Linear Solvers on NVIDIA GPUs
doc_url: https://docs.nvidia.com/cuda/cusolver/index.html

extra:
recipe-maintainers:
- adibbley
5 changes: 5 additions & 0 deletions recipes/libcusparse/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if not exist %PREFIX% mkdir %PREFIX%

move lib\x64\* %LIBRARY_LIB%
move bin\* %LIBRARY_BIN%
move include\* %LIBRARY_INC%
33 changes: 33 additions & 0 deletions recipes/libcusparse/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 ]] && mv pkg-config ${PREFIX}/lib/pkgconfig
[[ -d "$PREFIX/lib/pkgconfig" ]] && sed -E -i "s|cudaroot=.+|cudaroot=$PREFIX|g" $PREFIX/lib/pkgconfig/cusparse*.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/libcusparse/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arm_variant_type: # [aarch64]
- sbsa # [aarch64]
Loading