mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-03 10:36:59 +08:00
Default MIOPEN_FIND_MODE=FAST for amd instead of disabling cudnn
This commit is contained in:
parent
a1864c01f2
commit
84be5c3e79
@ -26,6 +26,7 @@ import importlib
|
|||||||
import platform
|
import platform
|
||||||
import weakref
|
import weakref
|
||||||
import gc
|
import gc
|
||||||
|
import os
|
||||||
|
|
||||||
class VRAMState(Enum):
|
class VRAMState(Enum):
|
||||||
DISABLED = 0 #No vram present: no need to move models to vram
|
DISABLED = 0 #No vram present: no need to move models to vram
|
||||||
@ -335,11 +336,11 @@ AMD_RDNA2_AND_OLDER_ARCH = ["gfx1030", "gfx1031", "gfx1010", "gfx1011", "gfx1012
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if is_amd():
|
if is_amd():
|
||||||
arch = torch.cuda.get_device_properties(get_torch_device()).gcnArchName
|
if os.getenv('MIOPEN_FIND_MODE') is None:
|
||||||
if not (any((a in arch) for a in AMD_RDNA2_AND_OLDER_ARCH)):
|
os.environ['MIOPEN_FIND_MODE'] = "FAST"
|
||||||
torch.backends.cudnn.enabled = False # Seems to improve things a lot on AMD
|
logging.info("Set: MIOPEN_FIND_MODE=FAST for better AMD performance, change by setting MIOPEN_FIND_MODE.")
|
||||||
logging.info("Set: torch.backends.cudnn.enabled = False for better AMD performance.")
|
|
||||||
|
|
||||||
|
arch = torch.cuda.get_device_properties(get_torch_device()).gcnArchName
|
||||||
try:
|
try:
|
||||||
rocm_version = tuple(map(int, str(torch.version.hip).split(".")[:2]))
|
rocm_version = tuple(map(int, str(torch.version.hip).split(".")[:2]))
|
||||||
except:
|
except:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user