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
8795447d
Unverified
Commit
8795447d
authored
Jan 14, 2024
by
Daniel Hiltgen
Committed by
GitHub
Jan 14, 2024
Browse files
Merge pull request #1966 from fpreiss/fpreiss/gen_linux_cuda_detection
improve cuda detection (rel. issue #1704)
parents
95ad9a9f
905862e1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
llm/generate/gen_linux.sh
llm/generate/gen_linux.sh
+14
-5
No files found.
llm/generate/gen_linux.sh
View file @
8795447d
...
@@ -39,8 +39,13 @@ amdGPUs() {
...
@@ -39,8 +39,13 @@ amdGPUs() {
}
}
echo
"Starting linux generate script"
echo
"Starting linux generate script"
if
[
-z
"
${
CUDACXX
}
"
-a
-x
/usr/local/cuda/bin/nvcc
]
;
then
if
[
-z
"
${
CUDACXX
}
"
]
;
then
if
[
-x
/usr/local/cuda/bin/nvcc
]
;
then
export
CUDACXX
=
/usr/local/cuda/bin/nvcc
export
CUDACXX
=
/usr/local/cuda/bin/nvcc
else
# Try the default location in case it exists
export
CUDACXX
=
$(
command
-v
nvcc
)
fi
fi
fi
COMMON_CMAKE_DEFS
=
"-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off"
COMMON_CMAKE_DEFS
=
"-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off"
source
$(
dirname
$0
)
/gen_common.sh
source
$(
dirname
$0
)
/gen_common.sh
...
@@ -109,16 +114,20 @@ else
...
@@ -109,16 +114,20 @@ else
echo
"Skipping CPU generation step as requested"
echo
"Skipping CPU generation step as requested"
fi
fi
if
[
-d
/usr/local/cuda/lib64/
]
;
then
if
[
-z
"
${
CUDA_LIB_DIR
}
"
]
;
then
# Try the default location in case it exists
CUDA_LIB_DIR
=
/usr/local/cuda/lib64
fi
if
[
-d
"
${
CUDA_LIB_DIR
}
"
]
;
then
echo
"CUDA libraries detected - building dynamic CUDA library"
echo
"CUDA libraries detected - building dynamic CUDA library"
init_vars
init_vars
CUDA_MAJOR
=
$(
ls
/usr/local/cuda/lib64
/libcudart.so.
*
|
head
-1
|
cut
-f3
-d
.
||
true
)
CUDA_MAJOR
=
$(
ls
"
${
CUDA_LIB_DIR
}
"
/libcudart.so.
*
|
head
-1
|
cut
-f3
-d
.
||
true
)
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
${
COMMON_CMAKE_DEFS
}
${
CMAKE_DEFS
}
"
BUILD_DIR
=
"
${
LLAMACPP_DIR
}
/build/linux/cuda
${
CUDA_VARIANT
}
"
BUILD_DIR
=
"
${
LLAMACPP_DIR
}
/build/linux/cuda
${
CUDA_VARIANT
}
"
CUDA_LIB_DIR
=
/usr/local/cuda/lib64
build
build
install
install
gcc
-fPIC
-g
-shared
-o
${
BUILD_DIR
}
/lib/libext_server.so
\
gcc
-fPIC
-g
-shared
-o
${
BUILD_DIR
}
/lib/libext_server.so
\
...
...
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