added rocm and hip hiding for certain nodes getting errors under zluda

This commit is contained in:
patientx 2025-01-19 17:49:55 +03:00 committed by GitHub
parent 88eae2b0d1
commit df418fc3fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,15 @@
# hide rocm and hip
import os
os.environ.pop("ROCM_HOME",None)
os.environ.pop("HIP_HOME",None)
os.environ.pop("ROCM_VERSION",None)
paths=os.environ["PATH"].split(";")
paths_no_rocm=[]
for path_ in paths:
if "rocm" not in path_.lower():
paths_no_rocm.append(path_)
os.environ["PATH"]=";".join(paths_no_rocm)
import torch
if torch.cuda.get_device_name().endswith("[ZLUDA]"):