mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[ROCM] Extend try-catch mechanism for ROCM detection (#99980)
ROCM path detection currently relies on `hipconfig`. On some systems when calling `hipconfig` through `subprocess` python raises a `NotADirectoryError` that isn't catch at the moment. This commit adds `NotADirectoryError` to exceptions catched when calling `hipconfig`. Fixes #98629 Pull Request resolved: https://github.com/pytorch/pytorch/pull/99980 Approved by: https://github.com/jeffdaily, https://github.com/malfet
This commit is contained in:
parent
df3455b716
commit
39ff87c6a4
|
|
@ -34,7 +34,7 @@ try:
|
|||
rocm_path = subprocess.check_output(["hipconfig", "--rocmpath"]).decode("utf-8")
|
||||
except subprocess.CalledProcessError:
|
||||
print(f"Warning: hipconfig --rocmpath failed, assuming {rocm_path}")
|
||||
except (FileNotFoundError, PermissionError):
|
||||
except (FileNotFoundError, PermissionError, NotADirectoryError):
|
||||
# Do not print warning. This is okay. This file can also be imported for non-ROCm builds.
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user