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-nvcc recipe #21350

Merged
merged 46 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6a9d375
Adding cuda_nvcc recipe
adibbley Nov 28, 2022
5919ec4
Add license_file
adibbley Nov 28, 2022
5bd1429
Adding summary
adibbley Nov 28, 2022
09e2531
Add suggested space
adibbley Nov 28, 2022
dbd0844
Set correct extension for Windows source
adibbley Nov 29, 2022
7c85b37
Move tests block to expected order
adibbley Nov 29, 2022
4ac9038
nvcc.profile.patch is unnecessary on Windows
adibbley Nov 29, 2022
d316b98
Update recipes/cuda_nvcc/meta.yaml
adibbley Nov 30, 2022
417a5b7
Removing output section and renaming to cuda-nvcc
adibbley Nov 30, 2022
7924319
Remove comment from example recipe
adibbley Dec 1, 2022
3d4b217
Rename recipe folder to cuda-nvcc
adibbley Dec 1, 2022
346d69d
Remove extra directory from windows test
adibbley Dec 1, 2022
bc8f875
Replace existence test with version check
adibbley Dec 1, 2022
4159367
Updating for 12.0
adibbley Dec 12, 2022
8f8850e
Moving lib and include to targets
adibbley Dec 13, 2022
1a76fc9
Add libstdcxx-ng and libgcc-ng as host and run requirements on linux
adibbley Dec 13, 2022
98152ae
Update recipes/cuda-nvcc/meta.yaml
adibbley Dec 16, 2022
61eec82
Update recipes/cuda-nvcc/meta.yaml
adibbley Dec 16, 2022
3f3c155
Update recipes/cuda-nvcc/meta.yaml
adibbley Dec 16, 2022
51cdbb3
Update recipes/cuda-nvcc/meta.yaml
adibbley Dec 16, 2022
641b202
Removing missing_dso_whitelist
adibbley Dec 16, 2022
3368b1b
Update recipes/cuda-nvcc/meta.yaml
adibbley Jan 10, 2023
5d836c8
Fix spacing
adibbley Jan 10, 2023
9672270
Merge branch 'main' into cuda-nvcc
jakirkham Jan 11, 2023
da244ab
Update recipes/cuda-nvcc/meta.yaml
adibbley Jan 12, 2023
d82e926
Add simple test compile
adibbley Jan 23, 2023
87f4fc1
cuda-cudart-dev should now also require the static libraries
adibbley Jan 23, 2023
b123f9d
Update Windows paths
adibbley Jan 30, 2023
7390c24
Apply suggestions from code review
adibbley Jan 30, 2023
e01c93e
Add activate/deactivate scripts for setting NVCC_PREPEND_FLAGS
adibbley Feb 4, 2023
d7be9d4
Adding cuda-version to run_exports
adibbley Feb 18, 2023
7384618
Update recipes/cuda-nvcc/meta.yaml
adibbley Feb 28, 2023
3b34db3
Add cuda-nvcc_{{ target_platform }}
adibbley Mar 23, 2023
50e3ace
Fix indent
adibbley Mar 23, 2023
1271c83
Windows only patch to support cuda-cccl
adibbley Mar 24, 2023
e2397dc
Missing space for linter
adibbley Mar 24, 2023
786c01b
Merge branch 'main' into cuda-nvcc
jakirkham Mar 27, 2023
46d478c
Update to match other component changes
adibbley Apr 5, 2023
f6aa345
Remove test/requires, and sysroot to build
adibbley Apr 5, 2023
c925141
Move tests to top level.
bdice Apr 11, 2023
aaf8b3f
Merge pull request #6 from bdice/fix-nvcc-tests
adibbley Apr 12, 2023
054d71f
Merge branch 'main' into cuda-nvcc
jakirkham Apr 13, 2023
25209da
Merge branch 'main' into cuda-nvcc
jakirkham Apr 13, 2023
7d0a96e
Make a single output recipe.
bdice Apr 13, 2023
4e8d8c9
Merge pull request #7 from bdice/nvcc-single-output
adibbley Apr 13, 2023
579e8de
Add error when CXX not set
adibbley Apr 17, 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
17 changes: 17 additions & 0 deletions recipes/cuda-nvcc/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
if not exist %PREFIX% mkdir %PREFIX%
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if not exist %PREFIX% mkdir %PREFIX%
if not exist %PREFIX% mkdir %PREFIX%
if not exist %LIBRARY_PREFIX% mkdir %LIBRARY_PREFIX%

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm unfamiliar with Windows, is this something we should be doing in all of our recipes? We didn't do that in libcublas, for instance. We're not specifically writing anything to the %LIBRARY_PREFIX% directory in this file.


rem Directories...
for /D %%i in (.\*) do (
robocopy /E %%i %PREFIX%\%%i
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
robocopy /E %%i %PREFIX%\%%i
robocopy /E %%i %LIBRARY_PREFIX%\%%i

)

rem Files...
for %%i in (.\*) do (
if not %%~ni==build_env_setup (
if not %%~ni==conda_build (
if not %%~ni==metadata_conda_debug (
xcopy %%i %PREFIX%
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
xcopy %%i %PREFIX%
xcopy %%i %LIBRARY_PREFIX%

)
)
)
)
24 changes: 24 additions & 0 deletions recipes/cuda-nvcc/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# Install to conda style directories
[[ -d lib64 ]] && mv lib64 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
mkdir -p ${PREFIX}/${targetsDir}
mkdir -p ${PREFIX}/$i
cp -r $i ${PREFIX}/${targetsDir}
for j in `ls $i`; do
ln -s ../${targetsDir}/$i/$j ${PREFIX}/$i/$j
done
else
cp -r $i ${PREFIX}
fi
done
adibbley marked this conversation as resolved.
Show resolved Hide resolved
56 changes: 56 additions & 0 deletions recipes/cuda-nvcc/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% set name = "cuda-nvcc" %}
{% set version = "12.0.76" %}
{% set platform = "linux-x86_64" %} # [linux64]
{% set platform = "linux-ppc64le" %} # [ppc64le]
{% set platform = "linux-sbsa" %} # [aarch64]
{% set platform = "windows-x86_64" %} # [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_nvcc/{{ platform }}/cuda_nvcc-{{ platform }}-{{ version }}-archive.{{ extension }}

sha256: 160ca9f8828f53daa4b2066c5361aacb45fa2575885f70c223cda1d11df53d6f # [linux64]
sha256: dc5bd7eac57b32a9645c0c23c6a1ba8a9533e846eeec31414e1aa4230afee2f8 # [ppc64le]
sha256: 85c8c643ea2cfa398e1b5ffcd597f5bb3b738526c9e3fb8e39dd909c55345f36 # [aarch64]
sha256: f67406f44263f0e4a110a8cf0200bff1d3d0e32917db8a7c9e417a87eb7ca372 # [win]

build:
number: 0
skip: true # [osx]
adibbley marked this conversation as resolved.
Show resolved Hide resolved
run_exports:
strong:
- __glibc >=2.17 # [linux]

requirements:
adibbley marked this conversation as resolved.
Show resolved Hide resolved
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
host:
adibbley marked this conversation as resolved.
Show resolved Hide resolved
- sysroot_{{ target_platform }} 2.17 # [linux]
- __glibc >=2.17 # [linux]
run:
adibbley marked this conversation as resolved.
Show resolved Hide resolved
- sysroot_{{ target_platform }} 2.17 # [linux]
- __glibc >=2.17 # [linux]
adibbley marked this conversation as resolved.
Show resolved Hide resolved

test:
commands:
- nvcc --version
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

@robertmaynard robertmaynard Jan 25, 2023

Choose a reason for hiding this comment

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

we should add nvcc --ccbin "${CXX} -arch=native test.cu to validate that the __nvcc_device_query executable that nvcc calls in that case is also packaged

Copy link
Member

Choose a reason for hiding this comment

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

How should we handle cross-compiling use cases?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think what I am really asking for is a check that the expected internal executables exist in the package ( fatbinary, nvlink, cudafe++, __nvcc_device_query, etc ).

That would avoid any execution of nvcc

Copy link
Member

Choose a reason for hiding this comment

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

Will this still work even when there is no GPU?

Copy link
Contributor

Choose a reason for hiding this comment

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

Will this still work even when there is no GPU?

Yes. The compiler will generate a warning ( nvcc warning : Cannot find valid GPU for '-arch=native', default arch is used ) and continue to execute.


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: Compiler for CUDA applications.
description: |
Compiler for CUDA applications.
doc_url: https://docs.nvidia.com/cuda/index.html

extra:
recipe-maintainers:
- adibbley