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
0d651478
Unverified
Commit
0d651478
authored
Mar 11, 2024
by
Daniel Hiltgen
Committed by
GitHub
Mar 11, 2024
Browse files
Merge pull request #3056 from dhiltgen/rocm_link_clash
Avoid rocm runner and dependency clash
parents
41b00b98
bc13da2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
gpu/amd_linux.go
gpu/amd_linux.go
+1
-1
gpu/assets.go
gpu/assets.go
+8
-4
llm/generate/gen_linux.sh
llm/generate/gen_linux.sh
+1
-1
No files found.
gpu/amd_linux.go
View file @
0d651478
...
...
@@ -282,7 +282,7 @@ func AMDValidateLibDir() (string, error) {
}
// If we already have a rocm dependency wired, nothing more to do
rocmTargetDir
:=
filepath
.
Join
(
payloadsDir
,
"rocm"
)
rocmTargetDir
:=
filepath
.
Clean
(
filepath
.
Join
(
payloadsDir
,
".."
,
"rocm"
)
)
if
rocmLibUsable
(
rocmTargetDir
)
{
return
rocmTargetDir
,
nil
}
...
...
gpu/assets.go
View file @
0d651478
...
...
@@ -23,7 +23,9 @@ func PayloadsDir() (string, error) {
if
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"failed to generate tmp dir: %w"
,
err
)
}
payloadsDir
=
tmpDir
// We create a distinct subdirectory for payloads within the tmpdir
// This will typically look like /tmp/ollama3208993108/runners on linux
payloadsDir
=
filepath
.
Join
(
tmpDir
,
"runners"
)
}
return
payloadsDir
,
nil
}
...
...
@@ -32,10 +34,12 @@ func Cleanup() {
lock
.
Lock
()
defer
lock
.
Unlock
()
if
payloadsDir
!=
""
{
slog
.
Debug
(
"cleaning up"
,
"dir"
,
payloadsDir
)
err
:=
os
.
RemoveAll
(
payloadsDir
)
// We want to fully clean up the tmpdir parent of the payloads dir
tmpDir
:=
filepath
.
Clean
(
filepath
.
Join
(
payloadsDir
,
".."
))
slog
.
Debug
(
"cleaning up"
,
"dir"
,
tmpDir
)
err
:=
os
.
RemoveAll
(
tmpDir
)
if
err
!=
nil
{
slog
.
Warn
(
"failed to clean up"
,
"dir"
,
payloads
Dir
,
"err"
,
err
)
slog
.
Warn
(
"failed to clean up"
,
"dir"
,
tmp
Dir
,
"err"
,
err
)
}
}
}
...
...
llm/generate/gen_linux.sh
View file @
0d651478
...
...
@@ -185,7 +185,7 @@ if [ -d "${ROCM_PATH}" ]; then
init_vars
CMAKE_DEFS
=
"
${
COMMON_CMAKE_DEFS
}
${
CMAKE_DEFS
}
-DLLAMA_HIPBLAS=on -DCMAKE_C_COMPILER=
$ROCM_PATH
/llvm/bin/clang -DCMAKE_CXX_COMPILER=
$ROCM_PATH
/llvm/bin/clang++ -DAMDGPU_TARGETS=
$(
amdGPUs
)
-DGPU_TARGETS=
$(
amdGPUs
)
"
BUILD_DIR
=
"
${
LLAMACPP_DIR
}
/build/linux/
${
ARCH
}
/rocm
${
ROCM_VARIANT
}
"
EXTRA_LIBS
=
"-L
${
ROCM_PATH
}
/lib -L/opt/amdgpu/lib/x86_64-linux-gnu/ -Wl,-rpath,
\$
ORIGIN/../rocm/ -lhipblas -lrocblas -lamdhip64 -lrocsolver -lamd_comgr -lhsa-runtime64 -lrocsparse -ldrm -ldrm_amdgpu"
EXTRA_LIBS
=
"-L
${
ROCM_PATH
}
/lib -L/opt/amdgpu/lib/x86_64-linux-gnu/ -Wl,-rpath,
\$
ORIGIN/../
../
rocm/ -lhipblas -lrocblas -lamdhip64 -lrocsolver -lamd_comgr -lhsa-runtime64 -lrocsparse -ldrm -ldrm_amdgpu"
build
# Record the ROCM dependencies
...
...
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