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
ac4166cb
Commit
ac4166cb
authored
Apr 01, 2025
by
xuxz
Browse files
[Adaption] ollama0.6.3 for DCU
parent
e5d84fb9
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
576 deletions
+66
-576
README.md
README.md
+44
-554
discover/amd_linux.go
discover/amd_linux.go
+17
-17
ml/backend/ggml/ggml/src/ggml-cuda/common.cuh
ml/backend/ggml/ggml/src/ggml-cuda/common.cuh
+1
-1
ml/backend/ggml/ggml/src/ggml-cuda/mmvq.cu
ml/backend/ggml/ggml/src/ggml-cuda/mmvq.cu
+1
-1
ml/backend/ggml/ggml/src/ggml-hip/CMakeLists.txt
ml/backend/ggml/ggml/src/ggml-hip/CMakeLists.txt
+3
-3
No files found.
README.md
View file @
ac4166cb
This diff is collapsed.
Click to expand it.
discover/amd_linux.go
View file @
ac4166cb
...
...
@@ -43,7 +43,7 @@ const (
var
(
// Used to validate if the given ROCm lib is usable
ROCmLibGlobs
=
[]
string
{
"libhipblas.so.2*"
,
"rocblas"
}
// TODO - probably include more coverage of files here...
RocmStandardLocations
=
[]
string
{
"/opt/
rocm
/lib"
,
"/usr/lib64"
}
RocmStandardLocations
=
[]
string
{
"/opt/
dtk
/lib"
,
"/usr/lib64"
}
)
// Gather GPU information from the amdgpu driver if any supported GPUs are detected
...
...
@@ -55,11 +55,11 @@ func AMDGetGPUInfo() ([]RocmGPUInfo, error) {
}
// Opportunistic logging of driver version to aid in troubleshooting
driverMajor
,
driverMinor
,
err
:=
AMDDriverVersion
()
if
err
!=
nil
{
// TODO - if we see users crash and burn with the upstreamed kernel this can be adjusted to hard-fail rocm support and fallback to CPU
slog
.
Warn
(
"ollama recommends running the https://www.amd.com/en/support/linux-drivers"
,
"error"
,
err
)
}
//
driverMajor, driverMinor, err := AMDDriverVersion()
//
if err != nil {
//
// TODO - if we see users crash and burn with the upstreamed kernel this can be adjusted to hard-fail rocm support and fallback to CPU
//
slog.Warn("ollama recommends running the https://www.amd.com/en/support/linux-drivers", "error", err)
//
}
// Determine if the user has already pre-selected which GPUs to look at, then ignore the others
var
visibleDevices
[]
string
...
...
@@ -283,8 +283,8 @@ func AMDGetGPUInfo() ([]RocmGPUInfo, error) {
Name
:
name
,
Compute
:
fmt
.
Sprintf
(
"gfx%d%x%x"
,
major
,
minor
,
patch
),
MinimumMemory
:
rocmMinimumMemory
,
DriverMajor
:
driverMajor
,
DriverMinor
:
driverMinor
,
//
DriverMajor: driverMajor,
//
DriverMinor: driverMinor,
},
usedFilepath
:
usedFile
,
index
:
gpuID
,
...
...
@@ -413,15 +413,15 @@ func AMDGetGPUInfo() ([]RocmGPUInfo, error) {
// Quick check for AMD driver so we can skip amdgpu discovery if not present
func
AMDDetected
()
bool
{
// Some driver versions (older?) don't have a version file, so just lookup the parent dir
sysfsDir
:=
filepath
.
Dir
(
DriverVersionFile
)
_
,
err
:=
os
.
Stat
(
sysfsDir
)
if
errors
.
Is
(
err
,
os
.
ErrNotExist
)
{
slog
.
Debug
(
"amdgpu driver not detected "
+
sysfsDir
)
return
false
}
else
if
err
!=
nil
{
slog
.
Debug
(
"error looking up amd driver"
,
"path"
,
sysfsDir
,
"error"
,
err
)
return
false
}
//
sysfsDir := filepath.Dir(DriverVersionFile)
//
_, err := os.Stat(sysfsDir)
//
if errors.Is(err, os.ErrNotExist) {
//
slog.Debug("amdgpu driver not detected " + sysfsDir)
//
return false
//
} else if err != nil {
//
slog.Debug("error looking up amd driver", "path", sysfsDir, "error", err)
//
return false
//
}
return
true
}
...
...
ml/backend/ggml/ggml/src/ggml-cuda/common.cuh
View file @
ac4166cb
ml/backend/ggml/ggml/src/ggml-cuda/mmvq.cu
View file @
ac4166cb
ml/backend/ggml/ggml/src/ggml-hip/CMakeLists.txt
View file @
ac4166cb
...
...
@@ -40,9 +40,9 @@ find_package(hip REQUIRED)
find_package
(
hipblas REQUIRED
)
find_package
(
rocblas REQUIRED
)
if
(
${
hip_VERSION
}
VERSION_LESS 5.5
)
message
(
FATAL_ERROR
"At least ROCM/HIP V5.5 is required"
)
endif
()
#
if (${hip_VERSION} VERSION_LESS 5.5)
#
message(FATAL_ERROR "At least ROCM/HIP V5.5 is required")
#
endif()
message
(
STATUS
"HIP and hipBLAS found"
)
...
...
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