Re: RFC: Centralized ROCm target list + utility
Hi Christian,
On 2025-06-24 10:58, Christian Kastner wrote:
What would CMAKE_HIP_ARCHITECTURES entail? I did a grep on rocrand-6.4
with no result, but maybe it's used in some indirect way.
CMAKE_HIP_ARCHITECTURES is used for specifying the GPU targets when
compiling using CMake's support for the HIP language [1].
The rocrand library is built by telling CMake that it is building code
for the CXX language. The `-x hip` compiler flag is added by the
`hip::device` target, so that anything linking to that target is
actually built as HIP code. This method of building HIP programs uses
the (deprecated) AMDGPU_TARGETS or the (recommended) GPU_TARGETS
variables to control the build targets, and is unaffected by
CMAKE_HIP_ARCHITECTURES.
Would setting ROCM_TARGET_LST=/.../<codename> remove the need to
populate AMDGPU_TARGETS?
No. It would change the default target list, but many libraries
explicitly set some list of targets in their own build code. The
explicitly set targets in the library CMake code would mean that the
default is not used. For that reason, we probably won't want to rely on
it for setting the build targets in packages.
Sure, no problem. I think supporting comments would have been a nice
feature but the canonical interface is through the utility. And we
should also add a d/README.Debian with more info anyway.
Though I can't find for what this format actually is?
We should test to confirm, but I think it is just a file with one GPU
target on each line. I believe it is what you already specified, except
without comments.
I'm not expecting it to be all that useful in most scenarios, but it
seems like a reasonable thing to support given that it would require
almost no changes.
How would we do that?
The primary goal of this particular utility is build support. So one way
to disambiguate would be to rename the utility to 'rocm-build-support'
to make this distinction clearer.
How about 'rocm-target-archs'? Or 'rocm-build-targets'? I think I mildly
prefer the former, because 'build' is both a noun and a verb and you
need context to know which it is being used as.
That would also sidestep the word 'support', which I think might help
because I've seen that word confuse a lot of people in discussions about
GPU targets. Users naively ask "is my GPU supported?" but that question
means different things to different people.
Sincerely,
Cory Bloor
[1]:
https://cmake.org/cmake/help/latest/variable/CMAKE_HIP_ARCHITECTURES.html
Reply to: