Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
8a516ac8
Unverified
Commit
8a516ac8
authored
May 08, 2024
by
Daniel Hiltgen
Committed by
GitHub
May 08, 2024
Browse files
Merge pull request #4241 from dhiltgen/fix_tmp_override
Detect noexec and report a better error
parents
cef45fea
72700279
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
llm/server.go
llm/server.go
+9
-0
No files found.
llm/server.go
View file @
8a516ac8
...
@@ -307,6 +307,11 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
...
@@ -307,6 +307,11 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
slog
.
Debug
(
"subprocess"
,
"environment"
,
s
.
cmd
.
Env
)
slog
.
Debug
(
"subprocess"
,
"environment"
,
s
.
cmd
.
Env
)
if
err
=
s
.
cmd
.
Start
();
err
!=
nil
{
if
err
=
s
.
cmd
.
Start
();
err
!=
nil
{
// Detect permission denied and augment them essage about noexec
if
errors
.
Is
(
err
,
os
.
ErrPermission
)
{
finalErr
=
fmt
.
Errorf
(
"unable to start server %w. %s may have noexec set. Set OLLAMA_TMPDIR for server to a writable executable directory"
,
err
,
dir
)
continue
}
msg
:=
""
msg
:=
""
if
s
.
status
!=
nil
&&
s
.
status
.
LastErrMsg
!=
""
{
if
s
.
status
!=
nil
&&
s
.
status
.
LastErrMsg
!=
""
{
msg
=
s
.
status
.
LastErrMsg
msg
=
s
.
status
.
LastErrMsg
...
@@ -382,6 +387,10 @@ func (s *llmServer) getServerStatus(ctx context.Context) (ServerStatus, error) {
...
@@ -382,6 +387,10 @@ func (s *llmServer) getServerStatus(ctx context.Context) (ServerStatus, error) {
if
s
.
status
!=
nil
&&
s
.
status
.
LastErrMsg
!=
""
{
if
s
.
status
!=
nil
&&
s
.
status
.
LastErrMsg
!=
""
{
msg
=
s
.
status
.
LastErrMsg
msg
=
s
.
status
.
LastErrMsg
}
}
if
s
.
cmd
.
ProcessState
.
ExitCode
()
==
-
1
{
// Most likely a signal killed it, log some more details to try to help troubleshoot
slog
.
Warn
(
"llama runner process no longer running"
,
"sys"
,
s
.
cmd
.
ProcessState
.
Sys
(),
"string"
,
s
.
cmd
.
ProcessState
.
String
())
}
return
ServerStatusError
,
fmt
.
Errorf
(
"llama runner process no longer running: %d %s"
,
s
.
cmd
.
ProcessState
.
ExitCode
(),
msg
)
return
ServerStatusError
,
fmt
.
Errorf
(
"llama runner process no longer running: %d %s"
,
s
.
cmd
.
ProcessState
.
ExitCode
(),
msg
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment