conda-forge / conda-forge-ci-setup-feedstock

A conda-smithy repository for conda-forge-ci-setup.
BSD 3-Clause "New" or "Revised" License
13 stars 50 forks source link

Add cuda-profiler-api package #286

Closed carterbox closed 9 months ago

carterbox commented 9 months ago

https://github.com/conda-forge/magma-feedstock/pull/35#issuecomment-1745778381

Possibly we need to add the cuda profiler api package to CUDA 11.8 cross compiler environments, in order to fix

$SRC_DIR/sparse/blas/zgeisai_batched32.cu:16:10: fatal error: cuda_profiler_api.h: No such file or directory

When cross compiling for CUDA 11.8.

The cuda-profiler-api RHEL package only exists for 11-8 and 12-x, so I'm not sure what package name belongs in the "old" section.

Checklist

conda-forge-webservices[bot] commented 9 months ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

jakirkham commented 9 months ago

Thanks Daniel! 🙏

Had one suggestion above

carterbox commented 9 months ago

I'm pretty sure I did the most sensible thing in order to add the profiler-api package. How do I test this? If I build the magma-feedstock locally in Docker, it will pull from the internet and not use my locally build packages?

jakirkham commented 9 months ago

Thanks Daniel! 🙏

Yeah would run this build locally. Then link the build_artifacts from this feedstock directory into the feedstock directory to build (so they share the same build_artifacts directory). That way this package would be treated as part of the local package cache that can be installed

Edit: So it would look something like this

conda-forge-ci-setup
├── ...
├── build_artifacts
└── ...

magma
├── ...
├── build_artifacts -> conda-forge-ci-setup/build_artifacts
└── ...
carterbox commented 9 months ago

Linking the build_artifacts directory does not work. Maybe because conda-forge-ci-setup needs to be installed outside (before) of the conda-build context?

jakirkham commented 9 months ago

Don't think so. All these steps would happen within the container as part of setup

May need to add --use-local to these lines

Perhaps it is worth pushing these testing changes to some PR so we can discuss any other changes that might be needed (though hoping --use-local is all we need)

carterbox commented 9 months ago

Which variant of this package is installed for a cross compiling build for CUDA 11.8 on linux64 targeting aarch64?

jakirkham commented 9 months ago

Do the logs show which conda-forge-ci-setup package is pulled in now? If so, maybe we can figure out what variant is relevant based on that

carterbox commented 9 months ago

From my local docker build log:

  Package                          Version  Build              Channel           Size
───────────────────────────────────────────────────────────────────────────────────────
  Install:
───────────────────────────────────────────────────────────────────────────────────────

  + oniguruma                        6.9.8  h166bdaf_0         conda-forge      440kB
  + jq                                 1.6  h36c2ea0_1000      conda-forge      354kB
  + dataclasses                        0.8  pyhc8e2a94_3       conda-forge       10kB
  + joblib                           1.3.2  pyhd8ed1ab_0       conda-forge      221kB
  + json5                           0.9.14  pyhd8ed1ab_0       conda-forge       25kB
  + conda-env                        2.6.0  1                  conda-forge        2kB
  + shyaml                           0.6.2  pyhd3deb0d_0       conda-forge       22kB
  + oras-py                         0.1.14  pyhd8ed1ab_0       conda-forge       34kB
  + glob2                              0.7  py_0               conda-forge       12kB
  + pygments                        2.16.1  pyhd8ed1ab_0       conda-forge      853kB
  + mdurl                            0.1.0  pyhd8ed1ab_0       conda-forge       14kB
  + sniffio                          1.3.0  pyhd8ed1ab_0       conda-forge       14kB
  + exceptiongroup                   1.1.3  pyhd8ed1ab_0       conda-forge       19kB
  + backports                          1.0  pyhd8ed1ab_3       conda-forge        6kB
  + conda-oci-mirror                 0.1.0  pyhd8ed1ab_0       conda-forge       32kB
  + markdown-it-py                   3.0.0  pyhd8ed1ab_0       conda-forge       64kB
  + anyio                            3.7.1  pyhd8ed1ab_0       conda-forge       97kB
  + backports.functools_lru_cache    1.6.5  pyhd8ed1ab_0       conda-forge       12kB
  + conda-forge-metadata             0.5.3  pyhd8ed1ab_0       conda-forge       14kB
  + rich                            13.6.0  pyhd8ed1ab_0       conda-forge      183kB
  + watchgod                         0.8.2  pyhd8ed1ab_0       conda-forge       15kB
  + wcwidth                          0.2.8  pyhd8ed1ab_0       conda-forge       30kB
  + prompt-toolkit                  3.0.39  pyha770c72_0       conda-forge      269kB
  + prompt_toolkit                  3.0.39  hd8ed1ab_0         conda-forge        7kB
  + conda-forge-ci-setup            3.33.3  py310h7a2d8a0_100  conda-forge       60kB
  + boa                             0.14.0  pyhd8ed1ab_4       conda-forge       63kB

https://anaconda.org/conda-forge/conda-forge-ci-setup/files?version=3.33.3&page=2

CI: azure
c_compiler: gcc
c_compiler_version: '12'
cdt_name: cos6
channel_sources: conda-forge
channel_targets: conda-forge main
cpu_optimization_target: nocona
cran_mirror: https://cran.r-project.org
cuda_compiler: None
cuda_compiler_version: None
cxx_compiler: gxx
docker_image: quay.io/condaforge/linux-anvil-cos7-x86_64
extend_keys:
- ignore_version
- ignore_build_only_deps
- pin_run_as_build
- extend_keys
fortran_compiler: gfortran
ignore_build_only_deps:
- numpy
- python
lua: '5'
numpy: '1.22'
perl: 5.26.2
pin_run_as_build:
  python:
    max_pin: x.x
    min_pin: x.x
  r-base:
    min_pin: x.x
    max_pin: x.x
python: 3.10.* *_cpython
r_base: '3.5'
target_platform: linux-64
zip_keys:
- - c_compiler_version
  - cuda_compiler
  - cuda_compiler_version
  - cdt_name
  - docker_image

This is the vanilla linux64 variant; it is not what I was expecting. I expected to use a CUDA variant for a build of a CUDA package. Regardless, I have built locally a new version conda-forge-ci-setup-3.33.4-py310h7a2d8a0_100.conda and linked the build_artifacts folders. I even modified the build_steps to request the exact verison 3.33.4, but I think the local container is not picking up the local packages.

+ docker run -it -v /home/dching/Documents/magma-feedstock/recipe:/home/conda/recipe_root:rw,z,delegated -v /home/dching/Documents/magma-feedstock:/home/conda/feedstock_root:rw,z,delegated -e CONFIG -e HOST_USER_ID -e UPLOAD_PACKAGES -e IS_PR_BUILD -e GIT_BRANCH -e UPLOAD_ON_BRANCH -e CI -e FEEDSTOCK_NAME -e CPU_COUNT -e BUILD_WITH_CONDA_DEBUG -e BUILD_OUTPUT_ID -e BINSTAR_TOKEN -e FEEDSTOCK_TOKEN -e STAGING_BINSTAR_TOKEN quay.io/condaforge/linux-anvil-cuda:11.8 bash /home/conda/feedstock_root/.scripts/build_steps.sh
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
+ export FEEDSTOCK_ROOT=/home/conda/feedstock_root
+ FEEDSTOCK_ROOT=/home/conda/feedstock_root
+ source /home/conda/feedstock_root/.scripts/logging_utils.sh
Configuring conda
+ export PYTHONUNBUFFERED=1
+ PYTHONUNBUFFERED=1
+ export RECIPE_ROOT=/home/conda/recipe_root
+ RECIPE_ROOT=/home/conda/recipe_root
+ export CI_SUPPORT=/home/conda/feedstock_root/.ci_support
+ CI_SUPPORT=/home/conda/feedstock_root/.ci_support
+ export CONFIG_FILE=/home/conda/feedstock_root/.ci_support/linux_aarch64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11.yaml
+ CONFIG_FILE=/home/conda/feedstock_root/.ci_support/linux_aarch64_c_compiler_version11cuda_compilernvcccuda_compiler_version11.8cxx_compiler_version11.yaml
+ cat
+ mamba install --update-specs --yes --channel conda-forge --use-local pip mamba conda-build boa conda-forge-ci-setup=3.33.4

Looking for: ['pip', 'mamba', 'conda-build', 'boa', 'conda-forge-ci-setup=3.33.4']

pkgs/main/linux-64 (check zst)                      Checked  0.1s
pkgs/main/noarch (check zst)                        Checked  0.0s
pkgs/r/linux-64 (check zst)                        Checked  0.0s
pkgs/r/noarch (check zst)                          Checked  0.0s
pkgs/main/noarch                                   697.2kB @   5.3MB/s  0.1s
pkgs/r/linux-64                                      1.3MB @   8.5MB/s  0.2s
pkgs/main/linux-64                                   5.4MB @  30.8MB/s  0.2s
pkgs/r/noarch                                        1.1MB @   4.9MB/s  0.1s
conda-forge/linux-64                                29.6MB @  33.0MB/s  1.0s
conda-forge/noarch                                  12.2MB @  12.2MB/s  1.0s

Pinned packages:
  - python 3.10.*
  - su-exec 0.2
  - tini 0.19.0

Could not solve for environment specs
The following package could not be installed
└─ conda-forge-ci-setup 3.33.4**  does not exist (perhaps a typo or a missing channel).
Traceback (most recent call last):
  File "/home/dching/Documents/magma-feedstock/build-locally.py", line 105, in <module>
    main()
  File "/home/dching/Documents/magma-feedstock/build-locally.py", line 93, in main
    run_docker_build(ns)
  File "/home/dching/Documents/magma-feedstock/build-locally.py", line 29, in run_docker_build
    subprocess.check_call([script])
  File "/usr/lib64/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['.scripts/run_docker_build.sh']' returned non-zero exit status 1.
carterbox commented 9 months ago

The first problem was that docker was not following my symbolic link, so build_artifacts was empty inside the magma-feedstock docker container. I made a copy, and that brought the packages into the docker container. The second problem is that --use-local didn't pick up the build_artifacts directory, so I had to index and then add the folder as a channel.

conda index ${FEEDSTOCK_ROOT}/build_artifacts
mamba install --update-specs --yes --channel conda-forge --use-local --channel ${FEEDSTOCK_ROOT}/build_artifacts --override-channels \
    pip mamba conda-build boa conda-forge-ci-setup=3.33.4
carterbox commented 9 months ago

Great! I tested this locally, and it solves the problem on the magma feedstock of the missing cuda_profiler_api headers missing.

carterbox commented 9 months ago

@conda-forge-admin, please rerender

jakirkham commented 9 months ago

Thanks Daniel! 🙏

Sorry that wound up being more complicated to test. Think we should try to add this procedure to the conda-forge docs

Is this ready to take out of draft mode?

jakirkham commented 9 months ago

Thanks Daniel! 🙏

carterbox commented 9 months ago

Thanks for the feedback and suggestions, @jakirkham/@isuruf! 🥳

carterbox commented 9 months ago

@jakirkham, could you please restart the post-merge CI? One of the jobs failed.

xhochy commented 9 months ago

Retriggered

jakirkham commented 9 months ago

Uwe was faster! 🐎 😄

jakirkham commented 8 months ago

The first problem was that docker was not following my symbolic link...

Maybe this SO question has some useful tricks. Ideally we would bake one of these into the logic used to run our Docker builds