From 3dac017a6cb2acda01dbd82d91e77028d27768bd Mon Sep 17 00:00:00 2001 From: "Karl W. Schulz" Date: Fri, 16 Dec 2022 17:51:03 -0500 Subject: [PATCH] Add better error detection when local ROCM installation is incomplete. Closes #56. Signed-off-by: Karl W. Schulz [ROCm/rocprofiler-compute commit: 7a6331bfd6a5cfbd551e7301d3afc3c0ef391723] --- projects/rocprofiler-compute/src/utils/specs.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/projects/rocprofiler-compute/src/utils/specs.py b/projects/rocprofiler-compute/src/utils/specs.py index 2ae31481a5..bf2d49a7c8 100644 --- a/projects/rocprofiler-compute/src/utils/specs.py +++ b/projects/rocprofiler-compute/src/utils/specs.py @@ -24,6 +24,7 @@ import os import re +import sys import socket import subprocess @@ -174,12 +175,26 @@ def get_machine_specs(devicenum): "version-libs", "version-utils", ] + + rocmFound = False for itr in version_loc: _path = os.path.join(os.getenv("ROCM_PATH", "/opt/rocm"), ".info", itr) if os.path.exists(_path): + print(_path) rocm_ver = path(_path).read_text() + rocmFound = True break + if not rocmFound: + _rocm_path = os.getenv("ROCM_PATH", "/opt/rocm") + print("Error: Unable to detect a complete local ROCm installation.") + print( + "\nThe expected %s/.info/ versioning directory is missing. Please" + % _rocm_path + ) + print("ensure you have valid ROCm installation.") + sys.exit(1) + ( gpu_id, L1,