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>
This commit is contained in:
+10
-4
@@ -92,6 +92,7 @@ include(ROCMCheckTargetIds)
|
|||||||
|
|
||||||
rocm_setup_version(VERSION ${VERSION_STRING})
|
rocm_setup_version(VERSION ${VERSION_STRING})
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# SET GPU ARCHITECTURES
|
# SET GPU ARCHITECTURES
|
||||||
#############################################################################
|
#############################################################################
|
||||||
@@ -100,10 +101,15 @@ include(cmake/rocm_local_targets.cmake)
|
|||||||
set(DEFAULT_GPUS
|
set(DEFAULT_GPUS
|
||||||
gfx90a:xnack-;
|
gfx90a:xnack-;
|
||||||
gfx90a:xnack+;
|
gfx90a:xnack+;
|
||||||
gfx942:xnack-;
|
gfx942)
|
||||||
gfx942:xnack+;
|
|
||||||
gfx950:xnack-;
|
if(${ROCM_MAJOR_VERSION} GREATER 6)
|
||||||
gfx950:xnack+)
|
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)
|
if (BUILD_LOCAL_GPU_TARGET_ONLY)
|
||||||
message(STATUS "Building only for local GPU target")
|
message(STATUS "Building only for local GPU target")
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ rocSHMEM base requirements:
|
|||||||
* AMD GPUs
|
* AMD GPUs
|
||||||
* MI250X
|
* MI250X
|
||||||
* MI300X
|
* MI300X
|
||||||
|
* MI350X (Requires ROCm 7.0 or later)
|
||||||
* ROCm-aware Open MPI and UCX as described in
|
* ROCm-aware Open MPI and UCX as described in
|
||||||
[Building the Dependencies](#building-the-dependencies)
|
[Building the Dependencies](#building-the-dependencies)
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,37 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# GLOBAL COMPILE FLAGS
|
# 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})
|
foreach (root ${hip_ROOT} $ENV{hip_ROOT} ${ROCM_ROOT} $ENV{ROCM_ROOT} ${ROCM_PATH} $ENV{ROCM_PATH})
|
||||||
if (IS_DIRECTORY ${root})
|
if (IS_DIRECTORY ${root})
|
||||||
list(PREPEND CMAKE_PREFIX_PATH ${root})
|
list(PREPEND CMAKE_PREFIX_PATH ${root})
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ Requirements
|
|||||||
|
|
||||||
* MI300X
|
* MI300X
|
||||||
|
|
||||||
|
* MI350X (Requires ROCm 7.0 or later)
|
||||||
|
|
||||||
* ROCm-aware Open MPI and UCX. For more information, see :ref:`install-dependencies`.
|
* 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.
|
* Inter-node communication requires MPI, and is tested with Open MPI and CX7 Infiniband NICs.
|
||||||
|
|||||||
Reference in New Issue
Block a user