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 ( ...@@ -43,7 +43,7 @@ const (
var ( var (
// Used to validate if the given ROCm lib is usable // Used to validate if the given ROCm lib is usable
ROCmLibGlobs = []string{"libhipblas.so.2*", "rocblas"} // TODO - probably include more coverage of files here... 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 // Gather GPU information from the amdgpu driver if any supported GPUs are detected
...@@ -55,11 +55,11 @@ func AMDGetGPUInfo() ([]RocmGPUInfo, error) { ...@@ -55,11 +55,11 @@ func AMDGetGPUInfo() ([]RocmGPUInfo, error) {
} }
// Opportunistic logging of driver version to aid in troubleshooting // Opportunistic logging of driver version to aid in troubleshooting
driverMajor, driverMinor, err := AMDDriverVersion() // driverMajor, driverMinor, err := AMDDriverVersion()
if err != nil { // 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 // // 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) // 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 // Determine if the user has already pre-selected which GPUs to look at, then ignore the others
var visibleDevices []string var visibleDevices []string
...@@ -283,8 +283,8 @@ func AMDGetGPUInfo() ([]RocmGPUInfo, error) { ...@@ -283,8 +283,8 @@ func AMDGetGPUInfo() ([]RocmGPUInfo, error) {
Name: name, Name: name,
Compute: fmt.Sprintf("gfx%d%x%x", major, minor, patch), Compute: fmt.Sprintf("gfx%d%x%x", major, minor, patch),
MinimumMemory: rocmMinimumMemory, MinimumMemory: rocmMinimumMemory,
DriverMajor: driverMajor, // DriverMajor: driverMajor,
DriverMinor: driverMinor, // DriverMinor: driverMinor,
}, },
usedFilepath: usedFile, usedFilepath: usedFile,
index: gpuID, index: gpuID,
...@@ -413,15 +413,15 @@ func AMDGetGPUInfo() ([]RocmGPUInfo, error) { ...@@ -413,15 +413,15 @@ func AMDGetGPUInfo() ([]RocmGPUInfo, error) {
// Quick check for AMD driver so we can skip amdgpu discovery if not present // Quick check for AMD driver so we can skip amdgpu discovery if not present
func AMDDetected() bool { func AMDDetected() bool {
// Some driver versions (older?) don't have a version file, so just lookup the parent dir // Some driver versions (older?) don't have a version file, so just lookup the parent dir
sysfsDir := filepath.Dir(DriverVersionFile) // sysfsDir := filepath.Dir(DriverVersionFile)
_, err := os.Stat(sysfsDir) // _, err := os.Stat(sysfsDir)
if errors.Is(err, os.ErrNotExist) { // if errors.Is(err, os.ErrNotExist) {
slog.Debug("amdgpu driver not detected " + sysfsDir) // slog.Debug("amdgpu driver not detected " + sysfsDir)
return false // return false
} else if err != nil { // } else if err != nil {
slog.Debug("error looking up amd driver", "path", sysfsDir, "error", err) // slog.Debug("error looking up amd driver", "path", sysfsDir, "error", err)
return false // return false
} // }
return true return true
} }
......
...@@ -40,9 +40,9 @@ find_package(hip REQUIRED) ...@@ -40,9 +40,9 @@ find_package(hip REQUIRED)
find_package(hipblas REQUIRED) find_package(hipblas REQUIRED)
find_package(rocblas REQUIRED) find_package(rocblas REQUIRED)
if (${hip_VERSION} VERSION_LESS 5.5) #if (${hip_VERSION} VERSION_LESS 5.5)
message(FATAL_ERROR "At least ROCM/HIP V5.5 is required") # message(FATAL_ERROR "At least ROCM/HIP V5.5 is required")
endif() #endif()
message(STATUS "HIP and hipBLAS found") 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