Fix cuda with ipex on memmon.py

This commit is contained in:
Disty0
2023-05-29 00:34:31 +03:00
parent 54257dd226
commit 9dbe8bc6e4
+3 -7
View File
@@ -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