Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
90 changes: 70 additions & 20 deletions .github/workflows/build-ais.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,16 @@ jobs:
echo "Runtime Package:"
${{
format(
inputs.platform == 'ubuntu' && 'dpkg-deb -I {0}' || 'rpm -qpi --requires {0}',
inputs.platform == 'ubuntu' && 'dpkg-deb -I {0} && dpkg-deb -c {0}' ||
'rpm -qpil --requires {0}',
steps.pkg-metadata.outputs.AIS_HIPFILE_PKG_FILENAME
)
}}
echo -e "\n\nDevelopment Package:"
${{
format(
inputs.platform == 'ubuntu' && 'dpkg-deb -I {0}' || 'rpm -qpi --requires {0}',
inputs.platform == 'ubuntu' && 'dpkg-deb -I {0} && dpkg-deb -c {0}' ||
'rpm -qpil --requires {0}',
steps.pkg-metadata.outputs.AIS_HIPFILE_PKG_DEV_FILENAME
)
}}
Expand Down Expand Up @@ -220,6 +222,22 @@ jobs:
if-no-files-found: error
retention-days: 1
compression-level: 0
# CTestTestfiles.cmake hardcodes the absolute path of the GTest executables
# in the build directory. CTest relies on this metadata for execution. It is not
# trivial to modify this metadata, otherwise an installable test package could be
# used. For now, reuse the build directory.
- name: Copy hipFile build directory out of the container
run: |
docker cp \
"${AIS_CONTAINER_NAME}:/ais/hipFile/build" \
${GITHUB_WORKSPACE}/hipfile-build-dir
- name: Upload runtime hipFile Package as an Artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f #v6.0.0
with:
name: hipfile-build-dir-${{ inputs.platform }}
path: ${{ github.workspace }}/hipfile-build-dir
if-no-files-found: error
retention-days: 1
- name: Clean CMake build directories
run: |
docker exec \
Expand Down Expand Up @@ -324,6 +342,19 @@ jobs:
repository: ROCm/fio
ref: hipFile
path: fio
- name: Download hipFile runtime package
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 #v7.0.0
with:
name: ${{ needs.compile_on_AMD.outputs.ais_hipfile_pkg_filename }}
- name: Download hipFile development package
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 #v7.0.0
with:
name: ${{ needs.compile_on_AMD.outputs.ais_hipfile_pkg_dev_filename }}
- name: Download hipFile build directory
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 #v7.0.0
with:
name: hipfile-build-dir-${{ inputs.platform }}
path: ${{ github.workspace }}/hipfile-build-dir
- name: Authenticating to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #v3.6.0
with:
Expand Down Expand Up @@ -359,29 +390,45 @@ jobs:
mkdir /ais/hipFile/build
mkdir /ais/fio/build
'
- name: Generate build files for hipFile targeting the AMD platform (amdclang++)
- name: Copy the hipFile packages into the container
run: |
docker exec \
-t \
-w /ais/hipFile/build \
${AIS_CONTAINER_NAME} \
/bin/bash -c '
cmake \
-DCMAKE_CXX_COMPILER=amdclang++ \
-DCMAKE_CXX_FLAGS="-Werror" \
-DCMAKE_HIP_PLATFORM=amd \
-DAIS_BUILD_DOCS=ON \
..
'
- name: Build hipFile for the AMD platform (amdclang++)
docker cp \
${GITHUB_WORKSPACE}/${{ needs.compile_on_AMD.outputs.ais_hipfile_pkg_filename }} \
"${AIS_CONTAINER_NAME}:/root"
docker cp \
${GITHUB_WORKSPACE}/${{ needs.compile_on_AMD.outputs.ais_hipfile_pkg_dev_filename }} \
"${AIS_CONTAINER_NAME}:/root"
- name: Install the hipFile packages
run: |
docker exec \
-t \
-w /ais/hipFile/build \
-w /root \
${AIS_CONTAINER_NAME} \
/bin/bash -c '
cmake --build . --parallel
${{
format(
inputs.platform == 'ubuntu' && 'apt install -y ./{0} ./{1}' ||
inputs.platform == 'rocky' && 'dnf install -y ./{0} ./{1}' ||
inputs.platform == 'suse' && 'zypper install -y --allow-unsigned-rpm ./{0} ./{1}' ||
'echo "Unknown platform."; exit 1',
needs.compile_on_AMD.outputs.ais_hipfile_pkg_filename,
needs.compile_on_AMD.outputs.ais_hipfile_pkg_dev_filename
)
}}
'
# GitHub Build Artifacts do not preserve file permissions, namely the executable bit.
- name: Fix file permissions on GTest executables
run: |
chmod a+x \
${GITHUB_WORKSPACE}/hipfile-build-dir/test/hipfile_system_tests \
${GITHUB_WORKSPACE}/hipfile-build-dir/test/amd_detail/batch_mt \
${GITHUB_WORKSPACE}/hipfile-build-dir/test/amd_detail/state_mt \
${GITHUB_WORKSPACE}/hipfile-build-dir/examples/aiscp/aiscp
Comment on lines +417 to +424
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know that it would be an archive inside of an archive, but would it be worth creating a tar archive for the build directory, so you don't have this list to maintain?

Copy link
Copy Markdown
Collaborator Author

@riley-dixon riley-dixon Jan 9, 2026

Choose a reason for hiding this comment

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

If this list changes frequently then yes I think that would be worthwhile until we can figure out how to produce a "test" package compatible with CTest. Not too worried about it at this time though.

- name: Copy the hipFile build directory into the container
run: |
docker cp \
${GITHUB_WORKSPACE}/hipfile-build-dir/. \
"${AIS_CONTAINER_NAME}:/ais/hipFile/build"
- name: Run hipFile system tests for the AMD platform (amdclang++)
run: |
docker exec \
Expand Down Expand Up @@ -422,8 +469,8 @@ jobs:
HIPFILE=/ais/hipFile \
HIPFILELIB=${HIPFILE}/build/src/amd_detail/ \
HIP_PLATFORM=amd \
CFLAGS="-I${ROCM}/include -I${HIPFILE}/include" \
LDFLAGS="-L${ROCM}/lib -L${HIPFILELIB} -Wl,-rpath,${HIPFILELIB}" \
CFLAGS="-I${ROCM}/include" \
LDFLAGS="-L${ROCM}/lib -Wl,-rpath,${ROCM}/lib" \
../configure --enable-libhipfile
'
- name: Build fio
Expand Down Expand Up @@ -454,6 +501,9 @@ jobs:
if: ${{ always() }}
run: |
docker stop ${AIS_CONTAINER_NAME}
- name: Cleanup self-hosted runner workspace
if: ${{ always() }}
run: rm -rf ${GITHUB_WORKSPACE}/* ${GITHUB_WORKSPACE}/.*
compile_on_NVIDIA:
runs-on: [ubuntu-24.04]
strategy:
Expand Down
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ list(APPEND CMAKE_PREFIX_PATH
/opt/rocm/hip
)

# Set hipFile Install Path to the ROCm directory
# Note: CMAKE_INSTALL_PREFIX is set to a default by project().
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${ROCM_PATH}" CACHE PATH "The path where hipFile should be installed" FORCE)
endif()

# Fix library install directory to "lib" to be inline with the rest of ROCm
# Note: If testing is enabled, installing GTest calls GNUInstallDirs which will
# set this before ROCMInstallTargets can set it.
set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Directory name for installed ROCm libraries")

Comment on lines +120 to +130
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would it be worth setting CMAKE_INSTALL_PREFIX on the configuration instead of changing the default? Also, when I test this, the ROCM_PATH is set to /opt/rocm, which is a symlink to the path of the versioned rocm directory. I think the package should be installing to the real path.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

In TheRock, ROCM_PATH (or more typically ROCM_DIR) is set by a driver build script that gets passed into CMake - which eventually hits a block like above. So, I think the thing that needs to change instead is how ROCM_PATH gets set. Right now, our CI isn't setup to be configurable on a variable ROCm version.

I think the package should be installing to the real path.

I agree but point back to the limitation that currently exists in our CI.

#-----------------------------------------------------------------------------
# Import useful things for later
#-----------------------------------------------------------------------------
Expand Down
Loading