Skip to content

server: explicitly set exec path when create new instance#17669

Merged
ngxson merged 5 commits intoggml-org:masterfrom
ngxson:xsn/server_explicit_exec_path
Dec 2, 2025
Merged

server: explicitly set exec path when create new instance#17669
ngxson merged 5 commits intoggml-org:masterfrom
ngxson:xsn/server_explicit_exec_path

Conversation

@ngxson
Copy link
Copy Markdown
Contributor

@ngxson ngxson commented Dec 1, 2025

Trying to fix #16487 (comment)

In some cases, the first argument from the parent process doesn't reflect the binary path. So, we always resolve the binary path manually to make sure that it works.

@ngxson ngxson marked this pull request as ready for review December 1, 2025 22:37
@ngxson ngxson requested a review from ggerganov as a code owner December 1, 2025 22:37
@ngxson ngxson force-pushed the xsn/server_explicit_exec_path branch from 58cfded to 895aabb Compare December 1, 2025 22:41
Comment thread tools/server/server-models.cpp Outdated
int argc,
char ** argv,
char ** envp) : base_params(params) {
char ** envp) : base_params(params), server_binary_path(get_server_exec_path().string()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When get_server_exec_path throws, should we instead fallback to using argv[0] as the server binary path?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that's a good idea, I added it in 0dbf1e7

@ngxson ngxson merged commit 682e665 into ggml-org:master Dec 2, 2025
61 of 65 checks passed
Anico2 added a commit to Anico2/llama.cpp that referenced this pull request Jan 15, 2026
…7669)

* Revert "rm unused fn"

This reverts commit f2dbe9c.

* server: explicitly set exec path when create new instance

* put back TODO

* only call get_server_exec_path() once

* add fallback logic
blime4 referenced this pull request in blime4/llama.cpp Feb 5, 2026
* Revert "rm unused fn"

This reverts commit f2dbe9c087ac8776cd41f747a8b0ddf448c8399a.

* server: explicitly set exec path when create new instance

* put back TODO

* only call get_server_exec_path() once

* add fallback logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: allow load/unload models on server

2 participants