mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-14 07:22:36 +08:00
Add environment variable to opt out of #10302 (forced disablement of cudnn for all AMD users)
This commit is contained in:
parent
388b306a2b
commit
00184d155b
@ -334,11 +334,13 @@ SUPPORT_FP8_OPS = args.supports_fp8_compute
|
|||||||
AMD_RDNA2_AND_OLDER_ARCH = ["gfx1030", "gfx1031", "gfx1010", "gfx1011", "gfx1012", "gfx906", "gfx900", "gfx803"]
|
AMD_RDNA2_AND_OLDER_ARCH = ["gfx1030", "gfx1031", "gfx1010", "gfx1011", "gfx1012", "gfx906", "gfx900", "gfx803"]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if is_amd():
|
arch = torch.cuda.get_device_properties(get_torch_device()).gcnArchName
|
||||||
arch = torch.cuda.get_device_properties(get_torch_device()).gcnArchName
|
if not (any((a in arch) for a in AMD_RDNA2_AND_OLDER_ARCH)):
|
||||||
if not (any((a in arch) for a in AMD_RDNA2_AND_OLDER_ARCH)):
|
torch.backends.cudnn.enabled = os.environ.get("TORCH_BACKENDS_CUDNN_ENABLED", "0").strip().lower() not in {
|
||||||
torch.backends.cudnn.enabled = False # Seems to improve things a lot on AMD
|
"0", "off", "false", "disable", "disabled", "no"}
|
||||||
logging.info("Set: torch.backends.cudnn.enabled = False for better AMD performance.")
|
if not torch.backends.cudnn.enabled:
|
||||||
|
logging.info(
|
||||||
|
"ComfyUI has set torch.backends.cudnn.enabled to False for better AMD performance. Set environment var TORCH_BACKENDS_CUDDNN_ENABLED=1 to enable it again.")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rocm_version = tuple(map(int, str(torch.version.hip).split(".")[:2]))
|
rocm_version = tuple(map(int, str(torch.version.hip).split(".")[:2]))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user