Skip to content

make: consistent ROCm targets (rocm-strix-halo / rocm-generic) + portable lib paths (#357, #179)#365

Open
jamesburton wants to merge 1 commit into
antirez:mainfrom
jamesburton:pr-rocm-make
Open

make: consistent ROCm targets (rocm-strix-halo / rocm-generic) + portable lib paths (#357, #179)#365
jamesburton wants to merge 1 commit into
antirez:mainfrom
jamesburton:pr-rocm-make

Conversation

@jamesburton

Copy link
Copy Markdown

Two small ROCm build-ergonomics improvements (Makefile-only, additive).

#357 — name ROCm targets like the CUDA ones

The CUDA side has cuda-spark / cuda-generic / cuda CUDA_ARCH=, but ROCm only had strix-halo + a rocm alias. This adds the parallel names:

  • make rocm-strix-halo — gfx1151 preset (mirrors cuda-spark)
  • make rocm-generic ROCM_ARCH=gfxNNN — any Radeon (mirrors cuda-generic)
  • make rocm ROCM_ARCH=gfxN — explicit arch

strix-halo and rocm remain as back-compat aliases; help text updated to match. (Doing this now, while ROCm just landed, churns the fewest users — per the issue.)

#179 — build on non-/opt ROCm layouts

Adds ROCM_PATH (default /opt/rocm), searches both lib and lib64 (Fedora and other distros install ROCm libs under lib64), links the HIP runtime explicitly (-lamdhip64 — not always auto-added), and compiles host objects -fPIC so hipcc can link them. These codify the workarounds the #179 reporter verified on Fedora F44.

Verification

Target resolution checked with make -n (correct --offload-arch for rocm-strix-halo=gfx1151, rocm-generic ROCM_ARCH=gfx1100=gfx1100, and both aliases). The recipes are unchanged apart from the additive flags, so existing strix-halo builds are unaffected. Note: authored on a native-Windows HIP box, so the Linux /opt/rocm compile wasn't re-run here — would appreciate a maintainer sanity-build, especially of the -lamdhip64/lib64 link line on a standard install.

Closes #357. Addresses #179.

…le lib paths

Two ROCm build-ergonomics fixes:

- antirez#357: name the ROCm targets like the CUDA ones. Adds `rocm-strix-halo`
  (gfx1151 preset, mirrors `cuda-spark`) and `rocm-generic` (set ROCM_ARCH=gfxNNN,
  mirrors `cuda-generic`); `strix-halo` and `rocm` stay as back-compat aliases.
  Help text updated to match.
- antirez#179: build on non-/opt ROCm layouts. Add ROCM_PATH (default /opt/rocm), search
  both lib and lib64 (Fedora etc. use lib64), link the HIP runtime explicitly
  (-lamdhip64, not always auto-added), and compile host objects -fPIC so hipcc can
  link them. All additive.

Verified target resolution with `make -n` (offload-arch propagation for both
targets + aliases). The Linux ROCm compile itself was not re-run here (authored on
a Windows HIP box); changes are additive Makefile-only and recipe-preserving.

Closes antirez#357. Addresses antirez#179.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the Makefile to improve ROCm/HIP build ergonomics and compatibility across different ROCm installation layouts.

Changes:

  • Add ROCM_PATH and update ROCm link flags to search lib/lib64 and explicitly link amdhip64.
  • Introduce ROCm targets aligned with CUDA naming (rocm-strix-halo, rocm-generic) and keep back-compat aliases.
  • Refresh help output to reflect the new ROCm target structure and usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile
Comment on lines +38 to +40
# Search both lib and lib64 (Fedora and other non-/opt layouts install ROCm libs
# under lib64) and link the HIP runtime explicitly; some installs don't auto-add
# -lamdhip64. See issue #179. Override ROCM_PATH for a wheel/non-default install.
Comment thread Makefile
CUDA_LDLIBS ?= -lm -Xcompiler -pthread -L$(CUDA_HOME)/targets/sbsa-linux/lib -L$(CUDA_HOME)/lib64 -lcudart -lcublas
HIPCC ?= $(shell command -v hipcc 2>/dev/null || echo /opt/rocm/bin/hipcc)
ROCM_PATH ?= /opt/rocm
ROCM_ARCH ?= gfx1151
Comment thread Makefile
Comment on lines +116 to +118
rocm-strix-halo: ROCM_ARCH := gfx1151
rocm-strix-halo rocm-generic:
$(MAKE) -B ds4 ds4-server ds4-bench ds4-eval ds4-agent ROCM_ARCH="$(ROCM_ARCH)" \
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.

ROCm is just a "CUDA" alternative, isn't it?

2 participants