Compare commits

...

2 Commits

Author SHA1 Message Date
Eden 4d01f8ee40
Merge 2266f48d68 into 0fcb3760b2 2026-03-31 15:06:52 -05:00
許元豪 2266f48d68 cli, server: apply --prio process priority setting
The --prio flag was parsed but never applied in llama-cli and
llama-server. Only llama-completion and llama-bench called
set_process_priority(). Add the missing calls after backend
initialization so the flag takes effect in all tools.
2026-03-11 09:28:43 +08:00
2 changed files with 8 additions and 0 deletions

View File

@ -365,6 +365,10 @@ int main(int argc, char ** argv) {
llama_backend_init();
llama_numa_init(params.numa);
if (!set_process_priority(params.cpuparams.priority)) {
LOG_WRN("%s: failed to set process priority\n", __func__);
}
// TODO: avoid using atexit() here by making `console` a singleton
console::init(params.simple_io, params.use_color);
atexit([]() { console::cleanup(); });

View File

@ -108,6 +108,10 @@ int main(int argc, char ** argv) {
llama_backend_init();
llama_numa_init(params.numa);
if (!set_process_priority(params.cpuparams.priority)) {
LOG_WRN("%s: failed to set process priority\n", __func__);
}
LOG_INF("system info: n_threads = %d, n_threads_batch = %d, total_threads = %d\n", params.cpuparams.n_threads, params.cpuparams_batch.n_threads, std::thread::hardware_concurrency());
LOG_INF("\n");
LOG_INF("%s\n", common_params_get_system_info(params).c_str());