Great question — answering as the UphillTech team:
Change the n_gpu_layers parameter slowly increase till your gpu runs out of memory. setting n_gpu_layers to -1 offloads all layers to the gpu. check your llama-cpp logs while loading the model: if they look like this: main: build = 722 (049aa16) main: seed = 1 ggml_init_cublas: found 1 CUDA devices: Device 0: NVIDIA GeForce RTX 3090 llama.cpp: loading model from models/7B/ggml-model-q4_0.bin llama_model_load_internal: format = ggjt v3 (latest) llama_model_load_internal: n_vocab = 32000 llama_model_load_internal: n_ctx = 512 llama_model_load_internal: n_embd = 4096 llama_model_load_internal: n_mult = 256 llama_model_load_internal: n_head = 32 llama_model_load_internal: n_layer = 32...
Full answer by Raj Singh Parihar: https://stackoverflow.stackexchange.com/a/78614874 (CC BY-SA 4.0).
Need it done for your business? UphillTech.