Skip to content

Commit 40443a9

Browse files
committed
show available RAM, fixed SD vae tiling noise
1 parent 7966bdd commit 40443a9

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

koboldcpp.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,10 +1213,6 @@ def fetch_gpu_properties(testCL,testCU,testVK):
12131213
MaxMemory[0] = max(lowestclmem,MaxMemory[0])
12141214
except Exception:
12151215
pass
1216-
if MaxMemory[0]>0:
1217-
print(f"Detected Free GPU Memory: {int(MaxMemory[0]/1024/1024)} MB (Set GPU layers manually if incorrect)")
1218-
else:
1219-
print("Unable to determine GPU Memory")
12201216
return
12211217

12221218
def auto_set_backend_cli():
@@ -6672,6 +6668,17 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
66726668
args.threads = get_default_threads()
66736669
print(f"Auto Set Threads: {args.threads}")
66746670

6671+
if MaxMemory[0]>0:
6672+
print(f"Detected Available GPU Memory: {int(MaxMemory[0]/1024/1024)} MB")
6673+
else:
6674+
print("Unable to determine GPU Memory")
6675+
try:
6676+
import psutil
6677+
vmem = psutil.virtual_memory()
6678+
print(f"Detected Available RAM: {int(vmem.available/1024/1024)} MB")
6679+
except Exception:
6680+
print("Unable to determine available RAM")
6681+
66756682
init_library() # Note: if blas does not exist and is enabled, program will crash.
66766683
print("==========")
66776684
time.sleep(1)

otherarch/sdcpp/ggml_extend.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ typedef std::function<void(ggml_tensor*, ggml_tensor*, bool)> on_tile_process;
604604

605605
// Tiling
606606
__STATIC_INLINE__ void sd_tiling(ggml_tensor* input, ggml_tensor* output, const int scale, const int tile_size, const float tile_overlap_factor, on_tile_process on_processing) {
607+
output = ggml_set_f32(output, 0);
607608
int input_width = (int)input->ne[0];
608609
int input_height = (int)input->ne[1];
609610
int output_width = (int)output->ne[0];

0 commit comments

Comments
 (0)