Pinned mem also seems to work on AMD. (#10658)

This commit is contained in:
comfyanonymous 2025-11-05 16:11:15 -08:00 committed by GitHub
parent 1d69245981
commit 09dc24c8a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1087,7 +1087,7 @@ PINNED_MEMORY = {}
TOTAL_PINNED_MEMORY = 0
MAX_PINNED_MEMORY = -1
if not args.disable_pinned_memory:
if is_nvidia():
if is_nvidia() or is_amd():
if WINDOWS:
MAX_PINNED_MEMORY = get_total_memory(torch.device("cpu")) * 0.45 # Windows limit is apparently 50%
else: