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
681a9149
Commit
681a9149
authored
Jan 20, 2024
by
Daniel Hiltgen
Browse files
Add support for CUDA 5.2 cards
parent
4c54f0dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
gpu/gpu.go
gpu/gpu.go
+4
-3
llm/generate/gen_linux.sh
llm/generate/gen_linux.sh
+1
-1
No files found.
gpu/gpu.go
View file @
681a9149
...
@@ -29,8 +29,9 @@ type handles struct {
...
@@ -29,8 +29,9 @@ type handles struct {
var
gpuMutex
sync
.
Mutex
var
gpuMutex
sync
.
Mutex
var
gpuHandles
*
handles
=
nil
var
gpuHandles
*
handles
=
nil
// With our current CUDA compile flags, 5.2 and older will not work properly
// With our current CUDA compile flags, older than 5.2 will not work properly
const
CudaComputeMajorMin
=
6
// 5.0: CUDA error: no kernel image is available for execution on the device
var
CudaComputeMin
=
[
2
]
C
.
int
{
5
,
2
}
// Possible locations for the nvidia-ml library
// Possible locations for the nvidia-ml library
var
CudaLinuxGlobs
=
[]
string
{
var
CudaLinuxGlobs
=
[]
string
{
...
@@ -133,7 +134,7 @@ func GetGPUInfo() GpuInfo {
...
@@ -133,7 +134,7 @@ func GetGPUInfo() GpuInfo {
if
cc
.
err
!=
nil
{
if
cc
.
err
!=
nil
{
slog
.
Info
(
fmt
.
Sprintf
(
"error looking up CUDA GPU compute capability: %s"
,
C
.
GoString
(
cc
.
err
)))
slog
.
Info
(
fmt
.
Sprintf
(
"error looking up CUDA GPU compute capability: %s"
,
C
.
GoString
(
cc
.
err
)))
C
.
free
(
unsafe
.
Pointer
(
cc
.
err
))
C
.
free
(
unsafe
.
Pointer
(
cc
.
err
))
}
else
if
cc
.
major
>
=
CudaComputeM
ajorMin
{
}
else
if
cc
.
major
>
CudaComputeM
in
[
0
]
||
(
cc
.
major
==
CudaComputeMin
[
0
]
&&
cc
.
minor
>=
CudaComputeMin
[
1
])
{
slog
.
Info
(
fmt
.
Sprintf
(
"CUDA Compute Capability detected: %d.%d"
,
cc
.
major
,
cc
.
minor
))
slog
.
Info
(
fmt
.
Sprintf
(
"CUDA Compute Capability detected: %d.%d"
,
cc
.
major
,
cc
.
minor
))
resp
.
Library
=
"cuda"
resp
.
Library
=
"cuda"
}
else
{
}
else
{
...
...
llm/generate/gen_linux.sh
View file @
681a9149
...
@@ -125,7 +125,7 @@ if [ -d "${CUDA_LIB_DIR}" ]; then
...
@@ -125,7 +125,7 @@ if [ -d "${CUDA_LIB_DIR}" ]; then
if
[
-n
"
${
CUDA_MAJOR
}
"
]
;
then
if
[
-n
"
${
CUDA_MAJOR
}
"
]
;
then
CUDA_VARIANT
=
_v
${
CUDA_MAJOR
}
CUDA_VARIANT
=
_v
${
CUDA_MAJOR
}
fi
fi
CMAKE_DEFS
=
"-DLLAMA_CUBLAS=on
${
COMMON_CMAKE_DEFS
}
${
CMAKE_DEFS
}
"
CMAKE_DEFS
=
"-DLLAMA_CUBLAS=on
-DLLAMA_CUDA_FORCE_MMQ=on
${
COMMON_CMAKE_DEFS
}
${
CMAKE_DEFS
}
"
BUILD_DIR
=
"
${
LLAMACPP_DIR
}
/build/linux/
${
ARCH
}
/cuda
${
CUDA_VARIANT
}
"
BUILD_DIR
=
"
${
LLAMACPP_DIR
}
/build/linux/
${
ARCH
}
/cuda
${
CUDA_VARIANT
}
"
EXTRA_LIBS
=
"-L
${
CUDA_LIB_DIR
}
-lcudart -lcublas -lcublasLt -lcuda"
EXTRA_LIBS
=
"-L
${
CUDA_LIB_DIR
}
-lcudart -lcublas -lcublasLt -lcuda"
build
build
...
...
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