Commit ac4166cb authored by xuxz's avatar xuxz
Browse files

[Adaption] ollama0.6.3 for DCU

parent e5d84fb9
This diff is collapsed.
......@@ -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
}
......
......@@ -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")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment