mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
Fix cuda with ipex on memmon.py
This commit is contained in:
+3
-7
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user