-
Notifications
You must be signed in to change notification settings - Fork 90
Description
Unable to Determine Targets or Families
In the scenario that you're trying to build ROCm without an existing instance of ROCm, I found it incredibly difficult to determine a proper THEROCK_AMDGPU_FAMILIES
or THEROCK_AMDGPU_TARGETS
.
All documentation suggests using rocminfo
to determine these values for your hardware. Though I found it bizarre I couldn't just target "all", I tried determining this by compiling rocminfo
.
This has been moved to rocm-systems/projects/rocminfo
.
cd rocm-systems/projects/rocminfo
mkdir -p build
cd build
$ cmake -DCMAKE_PREFIX_PATH=/opt/rocm ..
CMake Deprecation Warning at CMakeLists.txt:37 (cmake_minimum_required):
Compatibility with CMake < 3.10 will be removed from a future version of
CMake.
Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.
CMake Error at CMakeLists.txt:66 (find_package):
By not providing "Findhsa-runtime64.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"hsa-runtime64", but CMake did not find one.
Could not find a package configuration file provided by "hsa-runtime64"
(requested version 1.0) with any of the following names:
hsa-runtime64Config.cmake
hsa-runtime64-config.cmake
Add the installation prefix of "hsa-runtime64" to CMAKE_PREFIX_PATH or set
"hsa-runtime64_DIR" to a directory containing one of the above files. If
"hsa-runtime64" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
and then I thought I found where to build libhsakmt
via rocr-runtime
...
[ 7%] Building C object libhsakmt/CMakeFiles/hsakmt.dir/src/topology.c.o
cd /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/libhsakmt && /usr/bin/cc -DHAVE_MEMFD_CREATE=1 -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/include -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src -I/usr/include/libdrm -I/usr/include -I/usr/include/libdrm -fPIC -W -Wall -Wextra -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -Wlogical-op -g -MD -MT libhsakmt/CMakeFiles/hsakmt.dir/src/topology.c.o -MF CMakeFiles/hsakmt.dir/src/topology.c.o.d -o CMakeFiles/hsakmt.dir/src/topology.c.o -c /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src/topology.c
[ 8%] Building C object libhsakmt/CMakeFiles/hsakmt.dir/src/rbtree.c.o
cd /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/libhsakmt && /usr/bin/cc -DHAVE_MEMFD_CREATE=1 -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/include -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src -I/usr/include/libdrm -I/usr/include -I/usr/include/libdrm -fPIC -W -Wall -Wextra -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -Wlogical-op -g -MD -MT libhsakmt/CMakeFiles/hsakmt.dir/src/rbtree.c.o -MF CMakeFiles/hsakmt.dir/src/rbtree.c.o.d -o CMakeFiles/hsakmt.dir/src/rbtree.c.o -c /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src/rbtree.c
[ 8%] Building C object libhsakmt/CMakeFiles/hsakmt.dir/src/spm.c.o
cd /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/libhsakmt && /usr/bin/cc -DHAVE_MEMFD_CREATE=1 -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/include -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src -I/usr/include/libdrm -I/usr/include -I/usr/include/libdrm -fPIC -W -Wall -Wextra -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -Wlogical-op -g -MD -MT libhsakmt/CMakeFiles/hsakmt.dir/src/spm.c.o -MF CMakeFiles/hsakmt.dir/src/spm.c.o.d -o CMakeFiles/hsakmt.dir/src/spm.c.o -c /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src/spm.c
[ 9%] Building C object libhsakmt/CMakeFiles/hsakmt.dir/src/version.c.o
cd /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/libhsakmt && /usr/bin/cc -DHAVE_MEMFD_CREATE=1 -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/include -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src -I/usr/include/libdrm -I/usr/include -I/usr/include/libdrm -fPIC -W -Wall -Wextra -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -Wlogical-op -g -MD -MT libhsakmt/CMakeFiles/hsakmt.dir/src/version.c.o -MF CMakeFiles/hsakmt.dir/src/version.c.o.d -o CMakeFiles/hsakmt.dir/src/version.c.o -c /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src/version.c
[ 9%] Building C object libhsakmt/CMakeFiles/hsakmt.dir/src/svm.c.o
cd /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/libhsakmt && /usr/bin/cc -DHAVE_MEMFD_CREATE=1 -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/include -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src -I/usr/include/libdrm -I/usr/include -I/usr/include/libdrm -fPIC -W -Wall -Wextra -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -Wlogical-op -g -MD -MT libhsakmt/CMakeFiles/hsakmt.dir/src/svm.c.o -MF CMakeFiles/hsakmt.dir/src/svm.c.o.d -o CMakeFiles/hsakmt.dir/src/svm.c.o -c /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src/svm.c
[ 10%] Building C object libhsakmt/CMakeFiles/hsakmt.dir/src/pc_sampling.c.o
cd /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/libhsakmt && /usr/bin/cc -DHAVE_MEMFD_CREATE=1 -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/include -I/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src -I/usr/include/libdrm -I/usr/include -I/usr/include/libdrm -fPIC -W -Wall -Wextra -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -Wlogical-op -g -MD -MT libhsakmt/CMakeFiles/hsakmt.dir/src/pc_sampling.c.o -MF CMakeFiles/hsakmt.dir/src/pc_sampling.c.o.d -o CMakeFiles/hsakmt.dir/src/pc_sampling.c.o -c /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/libhsakmt/src/pc_sampling.c
[ 10%] Linking C static library archive/libhsakmt.a
cd /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/libhsakmt && /usr/bin/cmake -P CMakeFiles/hsakmt.dir/cmake_clean_target.cmake
cd /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/libhsakmt && /usr/bin/cmake -E cmake_link_script CMakeFiles/hsakmt.dir/link.txt --verbose=1
/usr/bin/ar qc archive/libhsakmt.a CMakeFiles/hsakmt.dir/src/debug.c.o CMakeFiles/hsakmt.dir/src/events.c.o CMakeFiles/hsakmt.dir/src/fmm.c.o CMakeFiles/hsakmt.dir/src/globals.c.o CMakeFiles/hsakmt.dir/src/hsakmtmodel.c.o CMakeFiles/hsakmt.dir/src/libhsakmt.c.o CMakeFiles/hsakmt.dir/src/memory.c.o CMakeFiles/hsakmt.dir/src/openclose.c.o CMakeFiles/hsakmt.dir/src/perfctr.c.o CMakeFiles/hsakmt.dir/src/pmc_table.c.o CMakeFiles/hsakmt.dir/src/queues.c.o CMakeFiles/hsakmt.dir/src/time.c.o CMakeFiles/hsakmt.dir/src/topology.c.o CMakeFiles/hsakmt.dir/src/rbtree.c.o CMakeFiles/hsakmt.dir/src/spm.c.o CMakeFiles/hsakmt.dir/src/version.c.o CMakeFiles/hsakmt.dir/src/svm.c.o CMakeFiles/hsakmt.dir/src/pc_sampling.c.o
/usr/bin/ranlib archive/libhsakmt.a
make[2]: Leaving directory '/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build'
[ 10%] Built target hsakmt
make -f runtime/hsa-runtime/image/blit_src/CMakeFiles/opencl_blit_objects.dir/build.make runtime/hsa-runtime/image/blit_src/CMakeFiles/opencl_blit_objects.dir/depend
make[2]: Entering directory '/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build'
cd /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/runtime/hsa-runtime/image/blit_src /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/runtime/hsa-runtime/image/blit_src /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/runtime/hsa-runtime/image/blit_src/CMakeFiles/opencl_blit_objects.dir/DependInfo.cmake "--color="
make[2]: Leaving directory '/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build'
make -f runtime/hsa-runtime/image/blit_src/CMakeFiles/opencl_blit_objects.dir/build.make runtime/hsa-runtime/image/blit_src/CMakeFiles/opencl_blit_objects.dir/build
make[2]: Entering directory '/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build'
[ 10%] BUILDING bitcode for ocl_blit_object_gfx700...
cd /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build/runtime/hsa-runtime/image/blit_src && /usr/lib/llvm-19/bin/clang-19 -O2 -x cl -Xclang -finclude-default-header -cl-denorms-are-zero -cl-std=CL2.0 -target amdgcn-amd-amdhsa -mcpu=gfx700 -mcode-object-version=4 -o ocl_blit_object_gfx700 /home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/runtime/hsa-runtime/image/blit_src/imageblit_kernels.cl
clang-19: error: cannot find ROCm device library; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
make[2]: *** [runtime/hsa-runtime/image/blit_src/CMakeFiles/opencl_blit_objects.dir/build.make:225: runtime/hsa-runtime/image/blit_src/ocl_blit_object_gfx700] Error 1
make[2]: Leaving directory '/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build'
make[1]: *** [CMakeFiles/Makefile2:565: runtime/hsa-runtime/image/blit_src/CMakeFiles/opencl_blit_objects.dir/all] Error 2
make[1]: Leaving directory '/home/daryl/Source/therock/rocm-systems/projects/rocr-runtime/build'
make: *** [Makefile:159: all] Error 2
... but it needed something else.
I started looking to see if TheRock contained a way of generating this, looking into rocm-libraries/projects
, but I didn't see anything, but I tried throwing that at the rocminfo
configuration to see if it found what it needed (which did not work)
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm -DDCMAKE_CXX_FLAGS="--rocm-device-lib-path=../../../../rocm-libraries" ..
At this point, I tried to adjust my approach to simply find targets and families within the codebase itself. I found cmake/therock_amdgpu_targets.cmake and tried extracting the values.
I tried the following (before realizing I was pulling the wrong strings):
$ cmake -GNinja .. -DTHEROCK_AMDGPU_FAMILIES=gfx101,gfx1010,gfx1011,gfx1012,gfx103,gfx1030,gfx1032,gfx1035,gfx1036,gfx110,gfx1100,gfx1101,gfx1102,gfx1103,gfx115,gfx1150,gfx1151,gfx120,gfx1200,gfx1201,gfx90,gfx906,gfx908,gfx94,gfx942,gfx950
-- Configuring background job pool for 2 concurrent jobs
-- Enabling building tests
-- ROCm version: 7.0.0
-- HIP version: 7.1.0
-- Implicitly enabled features: HOST_SUITE_SPARSE HOST_BLAS
-- Enabled features:
-- * HOST_BLAS (-DTHEROCK_ENABLE_HOST_BLAS=ON)
-- * HOST_SUITE_SPARSE (-DTHEROCK_ENABLE_HOST_SUITE_SPARSE=ON)
-- * COMPILER (-DTHEROCK_ENABLE_COMPILER=ON)
-- * HIPIFY (-DTHEROCK_ENABLE_HIPIFY=ON)
-- * CORE_RUNTIME (-DTHEROCK_ENABLE_CORE_RUNTIME=ON)
-- * HIP_RUNTIME (-DTHEROCK_ENABLE_HIP_RUNTIME=ON)
-- * ROCPROF_TRACE_DECODER_BINARY (-DTHEROCK_ENABLE_ROCPROF_TRACE_DECODER_BINARY=ON)
-- * ROCPROFV3 (-DTHEROCK_ENABLE_ROCPROFV3=ON)
-- * RCCL (-DTHEROCK_ENABLE_RCCL=ON)
-- * PRIM (-DTHEROCK_ENABLE_PRIM=ON)
-- * BLAS (-DTHEROCK_ENABLE_BLAS=ON)
-- * RAND (-DTHEROCK_ENABLE_RAND=ON)
-- * FFT (-DTHEROCK_ENABLE_FFT=ON)
-- * SPARSE (-DTHEROCK_ENABLE_SPARSE=ON)
-- * SOLVER (-DTHEROCK_ENABLE_SOLVER=ON)
-- * COMPOSABLE_KERNEL (-DTHEROCK_ENABLE_COMPOSABLE_KERNEL=ON)
-- * MIOPEN (-DTHEROCK_ENABLE_MIOPEN=ON)
-- Configured AMDGPU Targets:
CMake Error at cmake/therock_amdgpu_targets.cmake:135 (message):
THEROCK_AMDGPU_FAMILIES value
'gfx101,gfx1010,gfx1011,gfx1012,gfx103,gfx1030,gfx1032,gfx1035,gfx1036,gfx110,gfx1100,gfx1101,gfx1102,gfx1103,gfx115,gfx1150,gfx1151,gfx120,gfx1200,gfx1201,gfx90,gfx906,gfx908,gfx94,gfx942,gfx950'
unknown. Available: gfx906 dgpu-all gfx90X-all gfx90X-dgpu gfx90X-dcgpu
gfx908 dcgpu-all gfx90a gfx942 gfx94X-all gfx94X-dcgpu gfx950 gfx950-all
gfx950-dcgpu gfx1010 gfx101X-all gfx101X-dgpu gfx1011 gfx1012 gfx1030
gfx103X-all gfx103X-dgpu gfx1032 gfx1035 gfx103X-igpu gfx1036 igpu-all
gfx1100 gfx110X-all gfx110X-dgpu gfx1101 gfx1102 gfx1103 gfx110X-igpu
gfx1150 gfx115X-all gfx115X-igpu gfx1151 gfx1200 gfx120X-all gfx1201
Call Stack (most recent call first):
CMakeLists.txt:319 (therock_validate_amdgpu_targets)
-- Configuring incomplete, errors occurred!
At least at this point I was getting somewhere and had more information, and I could figure out a way to pull out the appropriate strings.
However, I've searched the TheRock codebase for various segments of my CPU "Model name", but there are no hits. My THEROCK_AMDGPU_FAMILIES
doesn't exist in cmake/therock_amdgpu_targets.cmake
, but when I use it, the build seems to accept it and move forward.
These questions are not about my specific GPU or architecture and are general questions.
- What's the design purpose of selecting device targets and families instead of building for all supported devices by default?
- I understand wanting to have the capability of creating ROCm for a subset of devices, making more efficient builds, or those targeting specific devices for debugging, but this default behavior doesn't make sense and I am trying to understand
- How does one bootstrap ROCm via TheRock in such a way that they can build ROCm without knowing, or have a way of discovering the proper device targets and families?
- Is there a way to build
rocminfo
as a starting point, either to then build ROCm, or to simply haverocminfo
available with no plans on building ROCm? - Would it make sense to build a tool to assist people in determining their target or family, one that has zero to no dependencies (ie: .sh), to help provide such crucial information for one of the first steps of the TheRock ROCm build steps?
Thank you for your help and consideration.
Attach any links, screenshots, or additional evidence you think will be helpful.
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status