diff --git a/CMakeLists.txt b/CMakeLists.txt index 7be6c5c590..45ba954fe0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,6 +110,7 @@ if(NOT DEFINED ROCM_PATH) else() message(STATUS "ROCM_PATH found: ${ROCM_PATH}") endif() +set(ENV{ROCM_PATH} ${ROCM_PATH}) if("${CMAKE_CXX_COMPILER}" MATCHES ".*amdclang\\+\\+") message(STATUS "Compiling with amdclang++") @@ -639,7 +640,7 @@ set(GEN_DIR "${HIPIFY_DIR}/gensrc") # Execute the python script to generate required files execute_process( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/device/generate.py ${GEN_DIR} ${IFC_ENABLED} ${COLLTRACE} ${ENABLE_MSCCL_KERNEL} ${BUILD_LOCAL_GPU_TARGET_ONLY} ${ONLY_FUNCS} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/device/generate.py ${GEN_DIR} ${IFC_ENABLED} ${COLLTRACE} ${ENABLE_MSCCL_KERNEL} ${BUILD_LOCAL_GPU_TARGET_ONLY} ${ONLY_FUNCS} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} RESULT_VARIABLE gen_py_result ERROR_VARIABLE gen_py_error diff --git a/src/device/generate.py b/src/device/generate.py index 482975538d..c03abaf422 100755 --- a/src/device/generate.py +++ b/src/device/generate.py @@ -137,7 +137,9 @@ def calc_unroll_for_local_arch(): if not is_local_arch_only: return - res = subprocess.run(['rocminfo'], capture_output=True, text=True) + rocminfo_path = os.environ.get('ROCM_PATH') + "/bin/rocminfo" + + res = subprocess.run([rocminfo_path], stdout=subprocess.PIPE, universal_newlines=True) rocminfo_output = res.stdout # Parse rocminfo binary output