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
91390502
Unverified
Commit
91390502
authored
May 05, 2025
by
Jeffrey Morgan
Committed by
GitHub
May 05, 2025
Browse files
all: fix cgo compiler warnings on windows (#10563)
parent
7e5c8eee
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
discover/gpu_info_cudart.c
discover/gpu_info_cudart.c
+4
-4
discover/gpu_info_nvcuda.c
discover/gpu_info_nvcuda.c
+2
-2
llama/llama.go
llama/llama.go
+1
-0
ml/backend/ggml/ggml/src/ggml.go
ml/backend/ggml/ggml/src/ggml.go
+1
-0
No files found.
discover/gpu_info_cudart.c
View file @
91390502
...
@@ -58,7 +58,7 @@ void cudart_init(char *cudart_lib_path, cudart_init_resp_t *resp) {
...
@@ -58,7 +58,7 @@ void cudart_init(char *cudart_lib_path, cudart_init_resp_t *resp) {
LOG
(
resp
->
ch
.
verbose
,
"cudaSetDevice err: %d
\n
"
,
ret
);
LOG
(
resp
->
ch
.
verbose
,
"cudaSetDevice err: %d
\n
"
,
ret
);
UNLOAD_LIBRARY
(
resp
->
ch
.
handle
);
UNLOAD_LIBRARY
(
resp
->
ch
.
handle
);
resp
->
ch
.
handle
=
NULL
;
resp
->
ch
.
handle
=
NULL
;
if
(
ret
==
CUDA_ERROR_INSUFFICIENT_DRIVER
)
{
if
(
ret
==
CUDA
RT
_ERROR_INSUFFICIENT_DRIVER
)
{
resp
->
err
=
strdup
(
"your nvidia driver is too old or missing. If you have a CUDA GPU please upgrade to run ollama"
);
resp
->
err
=
strdup
(
"your nvidia driver is too old or missing. If you have a CUDA GPU please upgrade to run ollama"
);
return
;
return
;
}
}
...
@@ -168,9 +168,9 @@ void cudart_bootstrap(cudart_handle_t h, int i, mem_info_t *resp) {
...
@@ -168,9 +168,9 @@ void cudart_bootstrap(cudart_handle_t h, int i, mem_info_t *resp) {
resp
->
free
=
memInfo
.
free
;
resp
->
free
=
memInfo
.
free
;
resp
->
used
=
memInfo
.
used
;
resp
->
used
=
memInfo
.
used
;
LOG
(
h
.
verbose
,
"[%s] CUDA totalMem %lu
\n
"
,
resp
->
gpu_id
,
resp
->
total
);
LOG
(
h
.
verbose
,
"[%s] CUDA totalMem %
l
lu
\n
"
,
resp
->
gpu_id
,
resp
->
total
);
LOG
(
h
.
verbose
,
"[%s] CUDA freeMem %lu
\n
"
,
resp
->
gpu_id
,
resp
->
free
);
LOG
(
h
.
verbose
,
"[%s] CUDA freeMem %
l
lu
\n
"
,
resp
->
gpu_id
,
resp
->
free
);
LOG
(
h
.
verbose
,
"[%s] CUDA usedMem %lu
\n
"
,
resp
->
gpu_id
,
resp
->
used
);
LOG
(
h
.
verbose
,
"[%s] CUDA usedMem %
l
lu
\n
"
,
resp
->
gpu_id
,
resp
->
used
);
LOG
(
h
.
verbose
,
"[%s] Compute Capability %d.%d
\n
"
,
resp
->
gpu_id
,
resp
->
major
,
resp
->
minor
);
LOG
(
h
.
verbose
,
"[%s] Compute Capability %d.%d
\n
"
,
resp
->
gpu_id
,
resp
->
major
,
resp
->
minor
);
}
}
...
...
discover/gpu_info_nvcuda.c
View file @
91390502
...
@@ -193,8 +193,8 @@ void nvcuda_bootstrap(nvcuda_handle_t h, int i, mem_info_t *resp) {
...
@@ -193,8 +193,8 @@ void nvcuda_bootstrap(nvcuda_handle_t h, int i, mem_info_t *resp) {
resp
->
total
=
memInfo
.
total
;
resp
->
total
=
memInfo
.
total
;
resp
->
free
=
memInfo
.
free
;
resp
->
free
=
memInfo
.
free
;
LOG
(
h
.
verbose
,
"[%s] CUDA totalMem %lu mb
\n
"
,
resp
->
gpu_id
,
resp
->
total
/
1024
/
1024
);
LOG
(
h
.
verbose
,
"[%s] CUDA totalMem %
l
lu mb
\n
"
,
resp
->
gpu_id
,
resp
->
total
/
1024
/
1024
);
LOG
(
h
.
verbose
,
"[%s] CUDA freeMem %lu mb
\n
"
,
resp
->
gpu_id
,
resp
->
free
/
1024
/
1024
);
LOG
(
h
.
verbose
,
"[%s] CUDA freeMem %
l
lu mb
\n
"
,
resp
->
gpu_id
,
resp
->
free
/
1024
/
1024
);
LOG
(
h
.
verbose
,
"[%s] Compute Capability %d.%d
\n
"
,
resp
->
gpu_id
,
resp
->
major
,
resp
->
minor
);
LOG
(
h
.
verbose
,
"[%s] Compute Capability %d.%d
\n
"
,
resp
->
gpu_id
,
resp
->
major
,
resp
->
minor
);
...
...
llama/llama.go
View file @
91390502
...
@@ -2,6 +2,7 @@ package llama
...
@@ -2,6 +2,7 @@ package llama
/*
/*
#cgo CFLAGS: -std=c11
#cgo CFLAGS: -std=c11
#cgo windows CFLAGS: -Wno-dll-attribute-on-redeclaration
#cgo CXXFLAGS: -std=c++17
#cgo CXXFLAGS: -std=c++17
#cgo CPPFLAGS: -I${SRCDIR}/llama.cpp/include
#cgo CPPFLAGS: -I${SRCDIR}/llama.cpp/include
#cgo CPPFLAGS: -I${SRCDIR}/llama.cpp/common
#cgo CPPFLAGS: -I${SRCDIR}/llama.cpp/common
...
...
ml/backend/ggml/ggml/src/ggml.go
View file @
91390502
...
@@ -3,6 +3,7 @@ package ggml
...
@@ -3,6 +3,7 @@ package ggml
// #cgo CXXFLAGS: -std=c++17
// #cgo CXXFLAGS: -std=c++17
// #cgo CPPFLAGS: -DNDEBUG -DGGML_USE_CPU
// #cgo CPPFLAGS: -DNDEBUG -DGGML_USE_CPU
// #cgo CPPFLAGS: -I${SRCDIR}/../include -I${SRCDIR}/ggml-cpu
// #cgo CPPFLAGS: -I${SRCDIR}/../include -I${SRCDIR}/ggml-cpu
// #cgo windows CFLAGS: -Wno-dll-attribute-on-redeclaration
// #cgo windows LDFLAGS: -lmsvcrt -static -static-libgcc -static-libstdc++
// #cgo windows LDFLAGS: -lmsvcrt -static -static-libgcc -static-libstdc++
// #include <stdlib.h>
// #include <stdlib.h>
// #include "ggml-backend.h"
// #include "ggml-backend.h"
...
...
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