To enable GPU acceleration, you must explicitly instruct llama.cpp to offload model layers to your graphics hardware.
- Open the terminal or command prompt window used to launch your model.
- Identify your current execution command for the llama.cpp server or main binary.
- Append the
-ngl (number of GPU layers) flag to your command. For example, to offload all layers, use: -ngl 999. - Execute the updated command.
- Verify the fix by observing the console startup output; ensure it indicates that layers are being successfully offloaded to your GPU (e.g., 'X/X layers offloaded').
- Confirm GPU utilization by monitoring your hardware activity using
nvidia-smi or an equivalent GPU monitoring tool during inference.
Sources
Comments
Sign in to join the conversation
Sign InNo comments yet. Be the first to share your thoughts!