Added ability to build for local gpu by env Variable (#204)

* Added the ability to compile for Local gpu by environment variable

* adding gfx950 on default only on rocm 7.0 and above

* Updated docs

* removed xnack+ on specific gfx targets

---------

Co-authored-by: Yiltan Hassan Temucin <yiltan.temucin@amd.com>
Este commit está contenido en:
akolliasAMD
2025-08-11 12:35:50 -06:00
cometido por GitHub
padre e95360961d
commit be630d9b93
Se han modificado 4 ficheros con 45 adiciones y 5 borrados
+10 -4
Ver fichero
@@ -92,6 +92,7 @@ include(ROCMCheckTargetIds)
rocm_setup_version(VERSION ${VERSION_STRING})
#############################################################################
# SET GPU ARCHITECTURES
#############################################################################
@@ -100,10 +101,15 @@ include(cmake/rocm_local_targets.cmake)
set(DEFAULT_GPUS
gfx90a:xnack-;
gfx90a:xnack+;
gfx942:xnack-;
gfx942:xnack+;
gfx950:xnack-;
gfx950:xnack+)
gfx942)
if(${ROCM_MAJOR_VERSION} GREATER 6)
list(APPEND DEFAULT_GPUS gfx950)
endif()
if($ENV{BUILD_LOCAL_GPU_TARGET_ONLY})
set(BUILD_LOCAL_GPU_TARGET_ONLY ON)
endif()
if (BUILD_LOCAL_GPU_TARGET_ONLY)
message(STATUS "Building only for local GPU target")
+1
Ver fichero
@@ -28,6 +28,7 @@ rocSHMEM base requirements:
* AMD GPUs
* MI250X
* MI300X
* MI350X (Requires ROCm 7.0 or later)
* ROCm-aware Open MPI and UCX as described in
[Building the Dependencies](#building-the-dependencies)
+31
Ver fichero
@@ -31,6 +31,37 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING
###############################################################################
# GLOBAL COMPILE FLAGS
###############################################################################
# Try to establish ROCM_PATH (for find_package)
#==================================================================================================
if(NOT DEFINED ROCM_PATH)
# Guess default location
set(ROCM_PATH "/opt/rocm")
message(WARNING "Unable to find ROCM_PATH: Falling back to ${ROCM_PATH}")
else()
message(STATUS "ROCM_PATH found: ${ROCM_PATH}")
endif()
set(ENV{ROCM_PATH} ${ROCM_PATH})
## Check for ROCm version
if(ROCM_PATH)
message(STATUS "Reading ROCM version from ${ROCM_PATH}/.info/version")
file(READ "${ROCM_PATH}/.info/version" rocm_version_string)
else()
message(FATAL_ERROR "Could not determine ROCM version (set EXPLICIT_ROCM_VERSION or set ROCM_PATH to a valid installation)")
endif()
string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" rocm_version_matches ${rocm_version_string})
if (rocm_version_matches)
set(ROCM_MAJOR_VERSION ${CMAKE_MATCH_1})
set(ROCM_MINOR_VERSION ${CMAKE_MATCH_2})
set(ROCM_PATCH_VERSION ${CMAKE_MATCH_3})
message(STATUS "ROCm version: ${ROCM_MAJOR_VERSION}.${ROCM_MINOR_VERSION}.${ROCM_PATCH_VERSION}")
else()
message(WARNING "Failed to extract ROCm version.")
endif()
foreach (root ${hip_ROOT} $ENV{hip_ROOT} ${ROCM_ROOT} $ENV{ROCM_ROOT} ${ROCM_PATH} $ENV{ROCM_PATH})
if (IS_DIRECTORY ${root})
list(PREPEND CMAKE_PREFIX_PATH ${root})
+3 -1
Ver fichero
@@ -21,6 +21,8 @@ Requirements
* MI300X
* MI350X (Requires ROCm 7.0 or later)
* ROCm-aware Open MPI and UCX. For more information, see :ref:`install-dependencies`.
* Inter-node communication requires MPI, and is tested with Open MPI and CX7 Infiniband NICs.
@@ -34,7 +36,7 @@ rocSHMEM supports two network backends:
* The **RO (Reverse Offload)** backend enables communication between GPUs on different nodes through a NIC, using a host-based proxy to forward communication orders to and from the GPU. In this release, RO is the only inter-node communication backend and is built on an MPI-RMA compatibility layer.
You can activate IPC and RO backends in the same rocSHMEM build. In this case, IPC handles intra-node communication, while RO handles inter-node communication.
You can activate IPC and RO backends in the same rocSHMEM build. In this case, IPC handles intra-node communication, while RO handles inter-node communication.
.. note::