Skip to content

Rhel 8 clean#438

Merged
sshi-amd merged 9 commits into
ROCm:amd-stagingfrom
sshi-amd:RHEL-8-clean
Mar 17, 2026
Merged

Rhel 8 clean#438
sshi-amd merged 9 commits into
ROCm:amd-stagingfrom
sshi-amd:RHEL-8-clean

Conversation

@sshi-amd
Copy link
Copy Markdown
Contributor

@sshi-amd sshi-amd commented Mar 11, 2026

Motivation

Add RHEL 8 (EL8) support to the rocm-examples CI pipeline.

We use AlmaLinux 8 as the base image instead of official RHEL 8 because RHEL requires a Red Hat subscription for package access. Registering a subscription per container on every CI run is impractical. AlmaLinux 8 is a 1:1 binary-compatible RHEL 8 rebuild with the same glibc (2.28), kernel ABI, and package versions, so test results are representative of real RHEL 8 environments. This can be revisited if subscription-based images become feasible.

Technical Details

Installs gcc-toolset-13 and sets it as the default compiler. This is required because RHEL 8's GCC 8 ships std::filesystem in a static library (libstdc++fs.a) whose ABI layout for path::_M_split_cmpts() is incompatible with TheRock's libhsa-runtime64.so (built with a newer GCC that has std::filesystem integrated into libstdc++.so). The HSA runtime calls _M_split_cmpts in a global constructor before main(), and the linker resolves it to the binary's GCC 8 version, causing an immediate segfault. GCC 13 from gcc-toolset-13 provides an ABI-compatible libstdc++_nonshared that resolves this.

Conditionally adds $ROCM_PATH/lib/rocm_sysdeps/lib to LD_LIBRARY_PATH and sets LIBVA_DRIVERS_PATH/LIBVA_DRIVER_NAME when the rocm_sysdeps/lib directory exists. This is needed because TheRock bundles its own VA-API driver (radeonsi_drv_video.so) in rocm_sysdeps/lib, and without these env vars, vaInitialize() fails for rocJPEG and rocDecode tests.

The condition (if [ -d ... ]) ensures Ubuntu and SLES workflows are unaffected — those distros use system VA-API packages and don't have rocm_sysdeps.

Test Plan

Ran through CI and locally

Test Result

https://github.com/sshi-amd/rocm-examples/actions/runs/22974154055

Added/Updated documentation?

  • Yes
  • No, does not apply to this PR.

Included Visual Studio files?

  • Yes
  • No, does not apply to this PR.

Submission Checklist

sshi-amd and others added 6 commits March 11, 2026 18:14
- Add rhel-8.Dockerfile (AlmaLinux 8 based, with FFmpeg, glslang,
  Vulkan SDK, GLFW built from source for glibc 2.28 compatibility)
- Add rhel-8-subscription.Dockerfile (UBI8 based, for local testing)
- Add rhel-8 to DISTRO_MAP in configure_ci.py
- Add rhel-8 option to ci_therock.yml and ci_nightly.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ldconfig after FFmpeg source build in Dockerfile so shared
  libraries in /usr/local/lib are discoverable at runtime
- Skip rocjpeg and rocprofiler-sdk tests on RHEL 8 that segfault
  with TheRock nightly builds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lity

HIP runtime init segfaults (applications_fdtd, hip_module_api,
hip_linker_apis_file), rocjpeg, rocdecode FFmpeg tests, and
rocprofiler-sdk all fail on RHEL 8 with glibc 2.28. These pass
on Ubuntu 22.04 — upstream ROCm/TheRock issue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Root cause: GCC 8's static libstdc++fs exports std::filesystem::path::
_M_split_cmpts() with an ABI layout incompatible with TheRock's
libhsa-runtime64.so (built with a newer GCC). The HSA runtime's global
constructor resolves _M_split_cmpts to the binary's GCC 8 version,
causing an immediate segfault before main().

Fix: Install gcc-toolset-13 in the RHEL 8 container and make it the
default compiler. GCC 13's libstdc++_nonshared provides an ABI-compatible
std::filesystem implementation.

The remaining 4 failures (rocjpeg, rocdecode) were VA-API initialization
errors because LIBVA_DRIVERS_PATH was not set to TheRock's bundled
radeonsi driver. Conditionally set LIBVA_DRIVERS_PATH, LIBVA_DRIVER_NAME,
and add rocm_sysdeps/lib to LD_LIBRARY_PATH only when the directory
exists (TheRock installs only), so Ubuntu/SLES workflows are unaffected.

Verified: 429/429 tests pass (0 failures) in the RHEL 8 container.
@sshi-amd sshi-amd requested a review from a team as a code owner March 11, 2026 21:49
@zichguan-amd
Copy link
Copy Markdown
Collaborator

zichguan-amd commented Mar 12, 2026

Alma8 is a good base image, we can remove the rhel8 ubi. I think is best to also discard rhel8 naming for alma8.

Comment thread .github/build_tools/configure_ci.py Outdated
Comment thread .github/workflows/build-rocm-examples-reusable.yml Outdated
Comment thread .github/workflows/build-rocm-examples-reusable.yml Outdated
Comment thread Dockerfiles/rhel-8-subscription.Dockerfile Outdated
Comment thread Dockerfiles/almalinux-8.Dockerfile
Copy link
Copy Markdown
Collaborator

@zichguan-amd zichguan-amd left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

Comment thread .github/build_tools/configure_ci.py Outdated
Comment thread .github/workflows/build-rocm-examples-reusable.yml Outdated
@sshi-amd sshi-amd merged commit 0613e68 into ROCm:amd-staging Mar 17, 2026
78 of 81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants