mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
Fix offload detection with CPU only envs
This commit is contained in:
@@ -89,6 +89,8 @@ devices.device = devices.get_optimal_device()
|
||||
mem_stat = memory_stats()
|
||||
cpu_memory = round(mem_stat['ram']['total'] if "ram" in mem_stat else 0)
|
||||
gpu_memory = round(mem_stat['gpu']['total'] if "gpu" in mem_stat else 0)
|
||||
if gpu_memory == 0:
|
||||
gpu_memory = cpu_memory
|
||||
native = backend == Backend.DIFFUSERS
|
||||
if not files_cache.do_cache_folders:
|
||||
log.warning('File cache disabled: ')
|
||||
|
||||
@@ -10,7 +10,7 @@ def get_default_modes(cmd_opts, mem_stat):
|
||||
default_diffusers_offload_never = ''
|
||||
gpu_memory = round(mem_stat['gpu']['total'] if "gpu" in mem_stat else 0)
|
||||
if not (cmd_opts.lowvram or cmd_opts.medvram):
|
||||
if "gpu" in mem_stat:
|
||||
if "gpu" in mem_stat and gpu_memory != 0:
|
||||
if gpu_memory <= 4:
|
||||
cmd_opts.lowvram = True
|
||||
default_offload_mode = "sequential"
|
||||
|
||||
Reference in New Issue
Block a user