agent-ml/llamacpp/gpu-debug.mjs
Lilith def4abcb25 Add GPU debugging and testing scripts
Debug scripts used to diagnose CUDA layer offloading issue:
- context-test.mjs: Context size testing
- deep-check.mjs: Detailed CUDA initialization check
- gpu-debug.mjs: GPU loading debug output
- test-layers.mjs: gpuLayers parameter testing (found -1 bug)
- trace-init.mjs: Provider initialization tracing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 18:42:05 -08:00

18 lines
559 B
JavaScript

import { getLlama } from 'node-llama-cpp';
console.log('=== GPU Loading Debug ===\n');
// Try with explicit CUDA and debug
const llama = await getLlama({ gpu: 'cuda', debug: true });
console.log('Llama GPU:', llama.gpu);
const modelPath = '/var/home/lilith/.cache/models/Ministral-3-3B-Instruct-2512-Q8_0.gguf';
console.log('\nLoading model with gpuLayers: 999...');
const model = await llama.loadModel({
modelPath,
gpuLayers: 999, // Force all layers to GPU
});
console.log('\nModel loaded. GPU layers:', model.gpuLayers);
await model.dispose();