mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-04-04 07:46:16 +02:00
fix(AI): improve GPU detection logic
This commit is contained in:
parent
3ee3cffad9
commit
77f1868cf8
|
|
@ -475,34 +475,16 @@ export class DockerService {
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
} else if (gpuResult.type === 'amd') {
|
} else if (gpuResult.type === 'amd') {
|
||||||
// this._broadcast(
|
this._broadcast(
|
||||||
// service.service_name,
|
service.service_name,
|
||||||
// 'gpu-config',
|
'gpu-config',
|
||||||
// `AMD GPU detected. Using ROCm image and configuring container with GPU support...`
|
`AMD GPU detected. ROCm GPU acceleration is not yet supported in this version — proceeding with CPU-only configuration. GPU support for AMD will be available in a future update.`
|
||||||
// )
|
)
|
||||||
|
logger.warn('[DockerService] AMD GPU detected but ROCm support is not yet enabled. Using CPU-only configuration.')
|
||||||
// // Use ROCm image for AMD
|
// TODO: Re-enable AMD GPU support once ROCm image and device discovery are validated.
|
||||||
// finalImage = 'ollama/ollama:rocm'
|
// When re-enabling:
|
||||||
|
// 1. Switch image to 'ollama/ollama:rocm'
|
||||||
// // Dynamically discover and add AMD GPU devices
|
// 2. Restore _discoverAMDDevices() to map /dev/kfd and /dev/dri/* into the container
|
||||||
// const amdDevices = await this._discoverAMDDevices()
|
|
||||||
// if (!amdDevices || amdDevices.length === 0) {
|
|
||||||
// this._broadcast(
|
|
||||||
// service.service_name,
|
|
||||||
// 'gpu-config-error',
|
|
||||||
// `Failed to discover AMD GPU devices. Proceeding with CPU-only configuration...`
|
|
||||||
// )
|
|
||||||
// gpuHostConfig = { ...gpuHostConfig } // No GPU devices added
|
|
||||||
// logger.warn(`[DockerService] No AMD GPU devices discovered for Ollama`)
|
|
||||||
// } else {
|
|
||||||
// gpuHostConfig = {
|
|
||||||
// ...gpuHostConfig,
|
|
||||||
// Devices: amdDevices,
|
|
||||||
// }
|
|
||||||
// logger.info(
|
|
||||||
// `[DockerService] Configured ${amdDevices.length} AMD GPU devices for Ollama`
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
} else if (gpuResult.toolkitMissing) {
|
} else if (gpuResult.toolkitMissing) {
|
||||||
this._broadcast(
|
this._broadcast(
|
||||||
service.service_name,
|
service.service_name,
|
||||||
|
|
@ -732,10 +714,11 @@ export class DockerService {
|
||||||
// lspci not available (likely inside Docker container), continue
|
// lspci not available (likely inside Docker container), continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for AMD GPU via lspci
|
// Check for AMD GPU via lspci — restrict to display controller classes to avoid
|
||||||
|
// false positives from AMD CPU host bridges, PCI bridges, and chipset devices.
|
||||||
try {
|
try {
|
||||||
const { stdout: amdCheck } = await execAsync(
|
const { stdout: amdCheck } = await execAsync(
|
||||||
'lspci 2>/dev/null | grep -iE "amd|radeon" || true'
|
'lspci 2>/dev/null | grep -iE "VGA|3D controller|Display" | grep -iE "amd|radeon" || true'
|
||||||
)
|
)
|
||||||
if (amdCheck.trim()) {
|
if (amdCheck.trim()) {
|
||||||
logger.info('[DockerService] AMD GPU detected via lspci')
|
logger.info('[DockerService] AMD GPU detected via lspci')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user