Skip to content

Build Libraries

Build Libraries #1228

name: Build Libraries
on:
workflow_dispatch:
push:
branches: [ amd-staging, amd-mainline, release/** ]
paths:
- 'Libraries/**'
- '.github/workflows/**'
pull_request:
branches: [ amd-staging, amd-mainline, release/** ]
paths:
- 'Libraries/**'
- '.github/workflows/**'
schedule:
# Nightly at 2 AM UTC
- cron: '0 2 * * *'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
env:
DEBIAN_FRONTEND: noninteractive
GPU_TARGETS: gfx908;gfx90a;gfx942;gfx950;gfx1030;gfx1100;gfx1101;gfx1200;gfx1201
jobs:
build:
name: "Build Libraries Examples"
runs-on: self-hosted
defaults:
run:
shell: bash
container:
image: ghcr.io/rocm/rocm-examples-hip-libraries-rocm-ubuntu
steps:
# see https://github.com/dorny/paths-filter/issues/212
- uses: actions/checkout@v4
- name: Trust git directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
ck:
- 'Libraries/ComposableKernel/**'
- name: Set CK build flag
run: |
# Enable CK for: scheduled runs OR CK files changed
if [ "${{ github.event_name }}" == "schedule" ] || [ "${{ steps.changes.outputs.ck }}" == "true" ]; then
ENABLE_CK=ON
else
ENABLE_CK=OFF
fi
echo "ENABLE_CK=${ENABLE_CK}" >> $GITHUB_ENV
echo "ROCM_EXAMPLES_ENABLE_CK=${ENABLE_CK}"
- name: CMake Configure and Build
run: |
cd Libraries
cmake -DCMAKE_BUILD_TYPE=Release -DGPU_TARGETS="${GPU_TARGETS}" -DCMAKE_HIP_ARCHITECTURES="${GPU_TARGETS}" -DROCM_EXAMPLES_ENABLE_CK=${ENABLE_CK} -DROCM_EXAMPLES_ENABLE_OPENMP=ON -S . -B build
cmake --build build --parallel $(nproc)
- name: Make
run: |
sed -i '/rocCV/d' Libraries/Makefile
cd Libraries
make -j $(nproc) ROCM_EXAMPLES_ENABLE_CK=${ENABLE_CK} HIP_ARCHITECTURES="${GPU_TARGETS}"
# Clean the workspace here since other jobs may not have the permissions to do so later
# (needed for self-hosted runners)
- name: Clean the workspace
if: always()
run: find "$GITHUB_WORKSPACE" -mindepth 1 -delete