Skip to content

Commit

Permalink
Create a build test CI for the HIP Examples (#147)
Browse files Browse the repository at this point in the history
* Create a GitHub Action to build the HIP-Basic examples

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

* Add workflows for Applications and libraries

Thanks @Beanavil

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

* Remove `rocm-llvm-dev` from "Libraries" and "Applications" workflows

This package shouldn't be required for these workflows.

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
  • Loading branch information
dgaliffiAMD committed Aug 14, 2024
1 parent 95f75b6 commit 80958ca
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build_applications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build Applications

on:
push:
branches: [ develop, release/** ]
paths:
- 'Applications/**'
- '.github/workflows/**'
pull_request:
branches: [ develop, release/** ]
paths:
- 'Applications/**'
- '.github/workflows/**'

env:
ROCM_VERSION: 6.2
AMDGPU_INSTALLER_VERSION: 6.2.60200-1

jobs:
build:
name: "Build Applications Examples"
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
apt-get update -qq &&
apt-get install -y build-essential g++ glslang-tools \
python3 python3-pip libglfw3-dev libvulkan-dev locales wget
python3 -m pip install --upgrade pip
python3 -m pip install cmake
- name: Install ROCm Dev
run: |
export DEBIAN_FRONTEND=noninteractive
wget https://repo.radeon.com/amdgpu-install/${{ env.ROCM_VERSION }}/ubuntu/jammy/amdgpu-install_${{ env.AMDGPU_INSTALLER_VERSION }}_all.deb
apt-get -y install ./amdgpu-install_${{ env.AMDGPU_INSTALLER_VERSION }}_all.deb &&
apt-get update -qq &&
apt-get install -y \
rocm-dev rocm-llvm \
rocrand-dev hiprand-dev \
rocprim-dev hipcub-dev
rm -rf /var/lib/apt/lists/*
echo "/opt/rocm/bin" >> $GITHUB_PATH
echo "ROCM_PATH=/opt/rocm" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/rocm/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
apt-get autoclean
- name: Configure and Build
shell: bash
run: |
cd Applications && mkdir build && cd build
cmake -DGPU_ARCHITECTURES=all -S ..
cmake --build . -j 4
53 changes: 53 additions & 0 deletions .github/workflows/build_hip_basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build HIP-Basic

on:
push:
branches: [ develop, release/** ]
paths:
- 'HIP-Basic/**'
- '.github/workflows/**'
pull_request:
branches: [ develop, release/** ]
paths:
- 'HIP-Basic/**'
- '.github/workflows/**'

env:
ROCM_VERSION: 6.2
AMDGPU_INSTALLER_VERSION: 6.2.60200-1

jobs:
build:
name: "Build HIP Examples"
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
apt-get update -qq &&
apt-get install -y build-essential g++ glslang-tools \
python3 python3-pip libglfw3-dev libvulkan-dev locales wget
python3 -m pip install --upgrade pip
python3 -m pip install cmake
- name: Install ROCm Dev
run: |
export DEBIAN_FRONTEND=noninteractive
wget https://repo.radeon.com/amdgpu-install/${{ env.ROCM_VERSION }}/ubuntu/jammy/amdgpu-install_${{ env.AMDGPU_INSTALLER_VERSION }}_all.deb
apt-get -y install ./amdgpu-install_${{ env.AMDGPU_INSTALLER_VERSION }}_all.deb &&
apt-get update -qq &&
apt-get -y install rocm-dev rocm-llvm-dev
echo "/opt/rocm/bin" >> $GITHUB_PATH
echo "ROCM_PATH=/opt/rocm" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/rocm/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
apt-get autoclean
- name: Configure and Build
shell: bash
run: |
cd HIP-Basic && mkdir build && cd build
cmake -DGPU_ARCHITECTURES=all -S ..
cmake --build . -j 4
60 changes: 60 additions & 0 deletions .github/workflows/build_libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build Libraries

on:
push:
branches: [ develop, release/** ]
paths:
- 'Libraries/**'
- '.github/workflows/**'
pull_request:
branches: [ develop, release/** ]
paths:
- 'Libraries/**'
- '.github/workflows/**'

env:
ROCM_VERSION: 6.2
AMDGPU_INSTALLER_VERSION: 6.2.60200-1

jobs:
build:
name: "Build Libraries Examples"
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
apt-get update -qq &&
apt-get install -y build-essential g++ glslang-tools \
python3 python3-pip libglfw3-dev libvulkan-dev locales wget
python3 -m pip install --upgrade pip
python3 -m pip install cmake
- name: Install ROCm Dev
run: |
export DEBIAN_FRONTEND=noninteractive
wget https://repo.radeon.com/amdgpu-install/${{ env.ROCM_VERSION }}/ubuntu/jammy/amdgpu-install_${{ env.AMDGPU_INSTALLER_VERSION }}_all.deb
apt-get -y install ./amdgpu-install_${{ env.AMDGPU_INSTALLER_VERSION }}_all.deb &&
apt-get update -qq &&
apt-get install -y \
rocm-dev rocm-llvm \
rocrand-dev hiprand-dev \
rocprim-dev hipcub-dev \
rocblas-dev hipblas-dev \
rocsolver-dev hipsolver-dev \
rocfft-dev hipfft-dev \
rocsparse-dev \
rocthrust-dev
rm -rf /var/lib/apt/lists/*
echo "/opt/rocm/bin" >> $GITHUB_PATH
echo "ROCM_PATH=/opt/rocm" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/rocm/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
apt-get autoclean
- name: Configure and Build
shell: bash
run: |
cd Libraries && mkdir build && cd build
cmake -DGPU_ARCHITECTURES=all -S ..
cmake --build . -j 4

0 comments on commit 80958ca

Please sign in to comment.