Skip to content

Commit d6cf918

Browse files
committed
fix dev list with dl backends
1 parent d1dc8fb commit d6cf918

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

common/arg.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ bool common_params_parse(int argc, char ** argv, common_params & params, llama_e
345345
}
346346

347347
common_params_context common_params_parser_init(common_params & params, llama_example ex, void(*print_usage)(int, char **)) {
348+
// load dynamic backends
349+
ggml_backend_load_all();
350+
348351
common_params_context ctx_arg(params);
349352
ctx_arg.print_usage = print_usage;
350353
ctx_arg.ex = ex;
@@ -1345,12 +1348,13 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
13451348
{"--list-devices"},
13461349
"print list of available devices and exit",
13471350
[](common_params &) {
1351+
printf("Available devices:\n");
13481352
for (size_t i = 0; i < ggml_backend_dev_count(); ++i) {
13491353
auto * dev = ggml_backend_dev_get(i);
13501354
if (ggml_backend_dev_type(dev) == GGML_BACKEND_DEVICE_TYPE_GPU) {
13511355
size_t free, total;
13521356
ggml_backend_dev_memory(dev, &free, &total);
1353-
printf("%s: %s (%zu MiB, %zu MiB free)\n", ggml_backend_dev_name(dev), ggml_backend_dev_description(dev), total / 1024 / 1024, free / 1024 / 1024);
1357+
printf(" %s: %s (%zu MiB, %zu MiB free)\n", ggml_backend_dev_name(dev), ggml_backend_dev_description(dev), total / 1024 / 1024, free / 1024 / 1024);
13541358
}
13551359
}
13561360
exit(0);

common/common.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,6 @@ void common_init() {
377377
#endif
378378

379379
LOG_INF("build: %d (%s) with %s for %s%s\n", LLAMA_BUILD_NUMBER, LLAMA_COMMIT, LLAMA_COMPILER, LLAMA_BUILD_TARGET, build_type);
380-
381-
// load dynamic backends
382-
ggml_backend_load_all();
383380
}
384381

385382
std::string common_params_get_system_info(const common_params & params) {

0 commit comments

Comments
 (0)