From fc63de69582e68a981dd2b6af9fbce67c43d2629 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Tue, 17 Dec 2024 22:43:30 +0300 Subject: [PATCH] IPEX enable empty_cache fix for WSL on PyTorch --- modules/intel/ipex/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/intel/ipex/__init__.py b/modules/intel/ipex/__init__.py index 147aa2798..94b0cd0d4 100644 --- a/modules/intel/ipex/__init__.py +++ b/modules/intel/ipex/__init__.py @@ -122,7 +122,7 @@ def ipex_init(): # pylint: disable=too-many-statements torch.cuda.traceback = torch.xpu.traceback # Memory: - if legacy and 'linux' in sys.platform and "WSL2" in os.popen("uname -a").read(): + if 'linux' in sys.platform and "WSL2" in os.popen("uname -a").read(): torch.xpu.empty_cache = lambda: None torch.cuda.empty_cache = torch.xpu.empty_cache