mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-20 03:25:37 +00:00
When device is Auto (the default) then we will only consider discrete GPU's otherwise fallback to CPU.
This commit is contained in:
parent
8f99dca70f
commit
891ddafc33
@ -275,7 +275,7 @@ bool ChatLLM::loadModel(const ModelInfo &modelInfo)
|
|||||||
if (requestedDevice != "CPU") {
|
if (requestedDevice != "CPU") {
|
||||||
const size_t requiredMemory = m_llModelInfo.model->requiredMem(filePath.toStdString());
|
const size_t requiredMemory = m_llModelInfo.model->requiredMem(filePath.toStdString());
|
||||||
std::vector<LLModel::GPUDevice> availableDevices = m_llModelInfo.model->availableGPUDevices(requiredMemory);
|
std::vector<LLModel::GPUDevice> availableDevices = m_llModelInfo.model->availableGPUDevices(requiredMemory);
|
||||||
if (!availableDevices.empty() && requestedDevice == "Auto") {
|
if (!availableDevices.empty() && requestedDevice == "Auto" && devices.front().type == 2 /*a discrete gpu*/) {
|
||||||
m_llModelInfo.model->initializeGPUDevice(devices.front());
|
m_llModelInfo.model->initializeGPUDevice(devices.front());
|
||||||
} else {
|
} else {
|
||||||
for (LLModel::GPUDevice &d : availableDevices) {
|
for (LLModel::GPUDevice &d : availableDevices) {
|
||||||
|
Loading…
Reference in New Issue
Block a user