Allow user to supply rocm version via ROCM_VER env variable if not autodetected

due to missing .info directory (#56).

Signed-off-by: Karl W. Schulz <karl.schulz@amd.com>
This commit is contained in:
Karl W. Schulz
2022-12-21 10:31:31 -05:00
parent ae9c284d03
commit ebf3eb6dc4
+17 -8
View File
@@ -186,14 +186,23 @@ def get_machine_specs(devicenum):
break break
if not rocmFound: if not rocmFound:
_rocm_path = os.getenv("ROCM_PATH", "/opt/rocm") # check if ROCM_VER is supplied externally
print("Error: Unable to detect a complete local ROCm installation.") ROCM_VER_USER = os.getenv("ROCM_VER")
print( if ROCM_VER_USER is not None:
"\nThe expected %s/.info/ versioning directory is missing. Please" print(
% _rocm_path "Overriding missing ROCm version detection with ROCM_VER = %s"
) % ROCM_VER_USER
print("ensure you have valid ROCm installation.") )
sys.exit(1) rocm_ver = ROCM_VER_USER
else:
_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, gpu_id,