diff --git a/extra/amdpci/setup_python_cap.sh b/extra/amdpci/setup_python_cap.sh index 2ef3c5f6b7..97df87b7e9 100755 --- a/extra/amdpci/setup_python_cap.sh +++ b/extra/amdpci/setup_python_cap.sh @@ -1,3 +1,3 @@ #!/bin/bash PYTHON_PATH=$(readlink -f $(which python3)) -sudo setcap 'cap_dac_override,cap_sys_rawio,cap_sys_admin=ep' $PYTHON_PATH +sudo setcap 'cap_dac_override,cap_sys_rawio,cap_sys_admin,cap_ipc_lock=ep' $PYTHON_PATH diff --git a/tinygrad/runtime/support/compiler_amd.py b/tinygrad/runtime/support/compiler_amd.py index b9ba2563c8..fd00ea03b9 100644 --- a/tinygrad/runtime/support/compiler_amd.py +++ b/tinygrad/runtime/support/compiler_amd.py @@ -1,11 +1,13 @@ import ctypes, subprocess import tinygrad.runtime.autogen.comgr as comgr -comgr.amd_comgr_get_version(ctypes.byref(major:=ctypes.c_uint64()), ctypes.byref(minor:=ctypes.c_uint64())) assert comgr.AMD_COMGR_LANGUAGE_HIP == 4 -if major.value >= 3: - # in comgr 3 the values of enums in headers were changed: https://github.com/ROCm/llvm-project/issues/272 - import tinygrad.runtime.autogen.comgr_3 as comgr # type: ignore[no-redef] - assert comgr.AMD_COMGR_LANGUAGE_HIP == 3 +try: + comgr.amd_comgr_get_version(ctypes.byref(major:=ctypes.c_uint64()), ctypes.byref(minor:=ctypes.c_uint64())) + if major.value >= 3: + # in comgr 3 the values of enums in headers were changed: https://github.com/ROCm/llvm-project/issues/272 + import tinygrad.runtime.autogen.comgr_3 as comgr # type: ignore[no-redef] + assert comgr.AMD_COMGR_LANGUAGE_HIP == 3 +except AttributeError: pass # ignore if ROCm isn't installed from tinygrad.device import Compiler, CompileError from tinygrad.runtime.ops_llvm import LLVMCompiler from tinygrad.helpers import OSX, to_char_p_p