From 7c0062ec670d331b97046b75f430ddf999b753b0 Mon Sep 17 00:00:00 2001 From: matoro Date: Wed, 9 Oct 2024 13:56:30 -0400 Subject: [PATCH] Fix gpulayers autodetection for cublas & clblast backends This fixes `--gpulayers -1` paired with either `--usecublas` or `--useclblast` with no additional arguments. --- koboldcpp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koboldcpp.py b/koboldcpp.py index 8d73abe652315..29d9adbb545b7 100644 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -4491,7 +4491,7 @@ def main(launch_args,start_server=True): fetch_gpu_properties(False,True,True) pass if args.gpulayers==-1: - if MaxMemory[0] > 0 and (not args.usecpu) and (args.usecublas or (args.usevulkan is not None) or args.useclblast or sys.platform=="darwin"): + if MaxMemory[0] > 0 and (not args.usecpu) and ((args.usecublas is not None) or (args.usevulkan is not None) or (args.useclblast is not None) or sys.platform=="darwin"): extract_modelfile_params(args.model_param,args.sdmodel,args.whispermodel,args.mmproj) layeramt = autoset_gpu_layers(args.contextsize,args.sdquant,args.blasbatchsize) print(f"Auto Recommended GPU Layers: {layeramt}")