Set OCL_SET_SVM_SIZE on AMD. (#11139)

This commit is contained in:
comfyanonymous
2025-12-05 21:15:21 -08:00
committed by GitHub
parent 913f86b727
commit d7a0aef650
2 changed files with 20 additions and 10 deletions

View File

@ -167,6 +167,9 @@ if __name__ == "__main__":
os.environ['CUBLAS_WORKSPACE_CONFIG'] = ":4096:8"
import cuda_malloc
if "rocm" in cuda_malloc.get_torch_version_noimport():
os.environ['OCL_SET_SVM_SIZE'] = '262144' # set at the request of AMD
if 'torch' in sys.modules:
logging.warning("WARNING: Potential Error in code: Torch already imported, torch should never be imported before this point.")