From 9dbe8bc6e4c708d92eae8cd61c6b1063eb9cd100 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Mon, 29 May 2023 00:34:31 +0300 Subject: [PATCH] Fix cuda with ipex on memmon.py --- modules/memmon.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/memmon.py b/modules/memmon.py index 66fd9a8d4..1ea110f51 100644 --- a/modules/memmon.py +++ b/modules/memmon.py @@ -24,17 +24,13 @@ class MemUsageMonitor(threading.Thread): #torch.cuda.is_available() reports False when using IPEX. if shared.cmd_opts.use_ipex: self.cuda_mem_get_info() - torch.cuda.memory_stats("xpu") + torch.xpu.memory_stats("xpu") else: self.disabled = True else: try: - if shared.cmd_opts.use_ipex: - self.cuda_mem_get_info() - torch.cuda.memory_stats("xpu") - else: - self.cuda_mem_get_info() - torch.cuda.memory_stats(self.device) + self.cuda_mem_get_info() + torch.cuda.memory_stats(self.device) except Exception: self.disabled = True