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
17ce203a
Unverified
Commit
17ce203a
authored
Jun 15, 2024
by
Daniel Hiltgen
Committed by
GitHub
Jun 15, 2024
Browse files
Merge pull request #4875 from dhiltgen/rocm_gfx900_workaround
Rocm gfx900 workaround
parents
d76555ff
da3bf233
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
gpu/amd_linux.go
gpu/amd_linux.go
+5
-0
gpu/types.go
gpu/types.go
+3
-0
llm/server.go
llm/server.go
+10
-0
No files found.
gpu/amd_linux.go
View file @
17ce203a
...
...
@@ -333,6 +333,11 @@ func AMDGetGPUInfo() []RocmGPUInfo {
slog
.
Info
(
"skipping rocm gfx compatibility check"
,
"HSA_OVERRIDE_GFX_VERSION"
,
gfxOverride
)
}
// Check for env var workarounds
if
name
==
"1002:687f"
{
// Vega RX 56
gpuInfo
.
EnvWorkarounds
=
append
(
gpuInfo
.
EnvWorkarounds
,
[
2
]
string
{
"HSA_ENABLE_SDMA"
,
"0"
})
}
// The GPU has passed all the verification steps and is supported
resp
=
append
(
resp
,
gpuInfo
)
}
...
...
gpu/types.go
View file @
17ce203a
...
...
@@ -26,6 +26,9 @@ type GpuInfo struct {
// Any extra PATH/LD_LIBRARY_PATH dependencies required for the Library to operate properly
DependencyPath
string
`json:"lib_path,omitempty"`
// Extra environment variables specific to the GPU as list of [key,value]
EnvWorkarounds
[][
2
]
string
`json:"envs,omitempty"`
// GPU information
ID
string
`json:"gpu_id"`
// string to use for selection of this specific GPU
Name
string
`json:"name"`
// user friendly name if available
...
...
llm/server.go
View file @
17ce203a
...
...
@@ -320,6 +320,10 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
s
.
cmd
.
Stdout
=
os
.
Stdout
s
.
cmd
.
Stderr
=
s
.
status
envWorkarounds
:=
[][
2
]
string
{}
for
_
,
gpu
:=
range
gpus
{
envWorkarounds
=
append
(
envWorkarounds
,
gpu
.
EnvWorkarounds
...
)
}
visibleDevicesEnv
,
visibleDevicesEnvVal
:=
gpus
.
GetVisibleDevicesEnv
()
pathEnvVal
:=
strings
.
Join
(
libraryPaths
,
string
(
filepath
.
ListSeparator
))
...
...
@@ -334,6 +338,12 @@ func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, pr
}
else
if
devicesNeeded
&&
strings
.
EqualFold
(
cmp
[
0
],
visibleDevicesEnv
)
{
s
.
cmd
.
Env
[
i
]
=
visibleDevicesEnv
+
"="
+
visibleDevicesEnvVal
devicesNeeded
=
false
}
else
if
len
(
envWorkarounds
)
!=
0
{
for
_
,
kv
:=
range
envWorkarounds
{
if
strings
.
EqualFold
(
cmp
[
0
],
kv
[
0
])
{
s
.
cmd
.
Env
[
i
]
=
kv
[
0
]
+
"="
+
kv
[
1
]
}
}
}
}
if
pathNeeded
{
...
...
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