From 698392334f76c84dcd08b6099bcdc202b74bdfef Mon Sep 17 00:00:00 2001 From: nimlgen <138685161+nimlgen@users.noreply.github.com> Date: Fri, 22 Aug 2025 18:21:32 +0300 Subject: [PATCH] system: message for eaccess as well (#11785) --- tinygrad/runtime/support/system.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/runtime/support/system.py b/tinygrad/runtime/support/system.py index e4d4662c31..6238866156 100644 --- a/tinygrad/runtime/support/system.py +++ b/tinygrad/runtime/support/system.py @@ -85,7 +85,7 @@ class PCIDevice: if FileIOInterface.exists(rpath:=f"/sys/bus/pci/devices/{self.pcibus}/resource{i}_resize"): try: FileIOInterface(rpath, os.O_RDWR).write(str(int(FileIOInterface(rpath, os.O_RDONLY).read(), 16).bit_length() - 1)) except OSError as e: - if e.errno == errno.EPERM: + if e.errno in {errno.EPERM, errno.EACCES}: raise RuntimeError(f"Cannot resize BAR {i}: {e}. Permission error: run `extra/amdpci/setup_python_cap.sh`" " to allow python accessing device or run with sudo") from e raise RuntimeError(f"Cannot resize BAR {i}: {e}. Ensure the resizable BAR option is enabled on your system.") from e