Skip to content

Added GPU selection#984

Open
InfernoAmaruq wants to merge 1 commit into
bjornbytes:devfrom
InfernoAmaruq:gpu-select-add
Open

Added GPU selection#984
InfernoAmaruq wants to merge 1 commit into
bjornbytes:devfrom
InfernoAmaruq:gpu-select-add

Conversation

@InfernoAmaruq

Copy link
Copy Markdown

in lovr.conf, t.graphics.selectGPU takes a function and lets you choose what GPU you want lovr to use

Only for Vulkan

usage example for selecting discrete GPU:

-- in lovr.conf
t.graphics.selectGPU = function(gpus)
    for Idx, Device in ipairs(gpus) do
        if Device.discrete then return Idx end
    end
    return 1
end

Has fields: .vendor, .name, .id, .discrete, .renderer
Defaults to GPU at index 1 if no function provided or no return

in lovr.conf, t.graphics.selectGPU takes a function and lets you choose
what GPU you want lovr to use
@bjornbytes

bjornbytes commented Jul 20, 2026

Copy link
Copy Markdown
Owner

For this I was thinking of using the t.graphics.lowpower option that LÖVE recently added (true = pick first integrated GPU, false = pick first discrete GPU). Would this work for your use case? It's a little bit less powerful than the implementation here, but on the other hand people might get tired of writing a function to filter GPUs if they just wanted to use the integrated GPU.

@InfernoAmaruq

Copy link
Copy Markdown
Author

Oh that would also be nice. My goal was making it so you can select a specific GPU since sometimes igpu is chosen when a dgpu is present

If lowpower does the same thing then I see it as a win

@bjornbytes

Copy link
Copy Markdown
Owner

I guess one other thing to consider is that WebGPU only exposes low-power and high-performance GPU selection, so lowpower could work on WebGPU whereas specific device selection couldn't map onto that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants