Files
TheRock/rocm-systems/.github/workflows/hipfile-build-nvidia.yml
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

120 lines
4.0 KiB
YAML

name: build-hipfile-NVIDIA
run-name: Build hipFile for NVIDIA platforms
env:
AIS_INPUT_CI_IMAGE: ${{ inputs.ci_image }}
AIS_INPUT_PLATFORM: ${{ inputs.platform }}
AIS_INPUT_ROCM_VERSION: ${{ inputs.rocm_version }}
AIS_MOUNT_PATH: /mnt/ais/ext4
on:
workflow_call:
inputs:
ci_image:
required: true
type: string
cxx_compiler:
required: true
type: string
platform:
required: true
type: string
rocm_version:
description: "Target ROCm MAJOR.MINOR.PATCH Version"
required: true
type: string
permissions:
contents: read
packages: read
jobs:
compile_on_NVIDIA:
env:
AIS_INPUT_CXX_COMPILER: ${{ inputs.cxx_compiler }}
runs-on: [ubuntu-24.04]
steps:
- name: Set early AIS CI environment variables
run: |
echo "AIS_PR_NUMBER=$(echo "${GITHUB_REF}" | sed 's|[^0-9]||g')" >> "${GITHUB_ENV}"
echo "AIS_SAFE_COMPILER_NAME=$(echo "${AIS_INPUT_CXX_COMPILER}" | sed 's|[\+]|plus|g')" >> "${GITHUB_ENV}"
- name: Set AIS CI container name
run: |
echo "AIS_CONTAINER_NAME=${AIS_PR_NUMBER}_${GITHUB_JOB}_${AIS_INPUT_PLATFORM}_${AIS_INPUT_ROCM_VERSION}_${AIS_SAFE_COMPILER_NAME}" >> "${GITHUB_ENV}"
- name: Fetching code repository...
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
path: rocm-systems
sparse-checkout: |
projects/hipfile
.github/workflows
- name: Authenticating to GitHub Container Registry
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Detach the container and run separate commands to it.
# Thus we can make separate explicit steps in the Github CI
# as if we were able to parameterize the container image in the first place.
- name: Starting Docker Container
run: |
docker run \
-dt \
--rm \
--pull always \
-v ${GITHUB_WORKSPACE}:/mnt/ais:ro \
-v "${AIS_MOUNT_PATH}:/mnt/ais-fs" \
--name "${AIS_CONTAINER_NAME}" \
"${AIS_INPUT_CI_IMAGE}"
- name: Make copy of the code repository and create build directories
run: |
docker exec \
-t \
"${AIS_CONTAINER_NAME}" \
/bin/bash -c '
cp -R /mnt/ais /ais
mkdir -p /ais/build/hipfile
'
- name: Generate build files for hipFile targeting the NVIDIA platform (${{ inputs.cxx_compiler }})
run: |
docker exec \
-e "_AIS_INPUT_CXX_COMPILER=${AIS_INPUT_CXX_COMPILER}" \
-t \
-w /ais/build/hipfile \
"${AIS_CONTAINER_NAME}" \
/bin/bash -c '
cmake \
-DCMAKE_CXX_COMPILER="${_AIS_INPUT_CXX_COMPILER}" \
-DCMAKE_CXX_FLAGS="-Werror" \
-DCMAKE_HIP_PLATFORM=nvidia \
../../rocm-systems/projects/hipfile
'
- name: Build hipFile for the NVIDIA platform (${{ inputs.cxx_compiler }})
run: |
docker exec \
-t \
-w /ais/build/hipfile \
"${AIS_CONTAINER_NAME}" \
/bin/bash -c '
cmake --build . --parallel
'
- name: Clean CMake build directories
run: |
docker exec \
-t \
-w /ais/ \
"${AIS_CONTAINER_NAME}" \
/bin/bash -c '
rm -rf build/hipfile/
'
- name: Cleanup & Stop the Docker container
if: ${{ always() }}
run: |
if docker inspect "${AIS_CONTAINER_NAME}" >/dev/null 2>&1; then
docker stop "${AIS_CONTAINER_NAME}"
else
echo "Container ${AIS_CONTAINER_NAME} does not exist; skipping stop"
fi