Preferences: GPU backend selection #126545

Merged
Jeroen Bakker merged 7 commits from Jeroen-Bakker/blender:vulkan/backend-selection into main 2024-09-06 08:29:00 +02:00
Member

This PR allows users to select a GPU backend.

Implements #126504

In the system tab of the user preferences the GPU backend can be selected in the Display Graphics panel.
image

During startup minimum requirements are checked. When not supported
Blender will use OpenGL in stead and show a dialog to the user.
image

When starting blender with --debug-gpu the backend detection will print to the console.

When no devices could be found meeting the minimum requirements the log
could look like.

WARN (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:178 is_supported: Device [AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO)] does not meet minimum requirements. Missing features are [VK_KHR_swapchain, VK_KHR_dedicated_allocation, VK_KHR_get_memory_requirements2, VK_KHR_dynamic_rendering, VK_EXT_dynamic_rendering_unused_attachments] 
WARN (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:178 is_supported: Device [AMD Radeon Graphics (RADV NAVI32)] does not meet minimum requirements. Missing features are [VK_KHR_swapchain, VK_KHR_dedicated_allocation, VK_KHR_get_memory_requirements2, VK_KHR_dynamic_rendering, VK_EXT_dynamic_rendering_unused_attachments] 
WARN (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:178 is_supported: Device [AMD Radeon Pro W6600 (RADV NAVI23)] does not meet minimum requirements. Missing features are [VK_KHR_swapchain, VK_KHR_dedicated_allocation, VK_KHR_get_memory_requirements2, VK_KHR_dynamic_rendering, VK_EXT_dynamic_rendering_unused_attachments] 
WARN (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:178 is_supported: Device [llvmpipe (LLVM 17.0.6, 256 bits)] does not meet minimum requirements. Missing features are [VK_KHR_swapchain, VK_KHR_dedicated_allocation, VK_KHR_get_memory_requirements2, VK_KHR_dynamic_rendering, VK_EXT_dynamic_rendering_unused_attachments] 
ERROR (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:184 is_supported: No Vulkan device found that meets the minimum requirements. Updating GPU driver can improve compatibility.

When a device could be found the log could look like:

INFO (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:161 is_supported: Device [AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO)] supports minimum requirements. Skip checking other GPUs. Another GPU can still be selected during auto-detection.
This PR allows users to select a GPU backend. Implements #126504 In the system tab of the user preferences the GPU backend can be selected in the `Display Graphics` panel. ![image](/attachments/7d83d4d9-149f-4cd5-9b22-38449791e9f2) During startup minimum requirements are checked. When not supported Blender will use OpenGL in stead and show a dialog to the user. ![image](/attachments/e5cf4605-b379-4150-bd97-824f4d1ba5f5) When starting blender with `--debug-gpu` the backend detection will print to the console. When no devices could be found meeting the minimum requirements the log could look like. ``` WARN (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:178 is_supported: Device [AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO)] does not meet minimum requirements. Missing features are [VK_KHR_swapchain, VK_KHR_dedicated_allocation, VK_KHR_get_memory_requirements2, VK_KHR_dynamic_rendering, VK_EXT_dynamic_rendering_unused_attachments] WARN (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:178 is_supported: Device [AMD Radeon Graphics (RADV NAVI32)] does not meet minimum requirements. Missing features are [VK_KHR_swapchain, VK_KHR_dedicated_allocation, VK_KHR_get_memory_requirements2, VK_KHR_dynamic_rendering, VK_EXT_dynamic_rendering_unused_attachments] WARN (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:178 is_supported: Device [AMD Radeon Pro W6600 (RADV NAVI23)] does not meet minimum requirements. Missing features are [VK_KHR_swapchain, VK_KHR_dedicated_allocation, VK_KHR_get_memory_requirements2, VK_KHR_dynamic_rendering, VK_EXT_dynamic_rendering_unused_attachments] WARN (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:178 is_supported: Device [llvmpipe (LLVM 17.0.6, 256 bits)] does not meet minimum requirements. Missing features are [VK_KHR_swapchain, VK_KHR_dedicated_allocation, VK_KHR_get_memory_requirements2, VK_KHR_dynamic_rendering, VK_EXT_dynamic_rendering_unused_attachments] ERROR (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:184 is_supported: No Vulkan device found that meets the minimum requirements. Updating GPU driver can improve compatibility. ``` When a device could be found the log could look like: ``` INFO (gpu.vulkan): source/blender/gpu/vulkan/vk_backend.cc:161 is_supported: Device [AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO)] supports minimum requirements. Skip checking other GPUs. Another GPU can still be selected during auto-detection. ```
Jeroen Bakker added this to the 4.3 milestone 2024-08-20 12:22:29 +02:00
Jeroen Bakker added the
Interest
Vulkan
Module
Viewport & EEVEE
labels 2024-08-20 12:22:29 +02:00
Jeroen Bakker self-assigned this 2024-08-20 12:22:30 +02:00
Jeroen Bakker added 1 commit 2024-08-20 12:22:38 +02:00
This PR allows users to select a GPU backend.

NOTE: Still WIP

**TODO**

- When not able to start the user pref should be reset.
Jeroen Bakker added this to the Viewport & EEVEE project 2024-08-20 12:22:44 +02:00
Jeroen Bakker changed title from Preferences: GPU backend selection to WIP: Preferences: GPU backend selection 2024-08-20 12:22:55 +02:00
Jeroen Bakker force-pushed vulkan/backend-selection from 412525ef76 to 2c3a4bdb97 2024-09-02 14:01:48 +02:00 Compare
Jeroen Bakker added 1 commit 2024-09-02 15:40:48 +02:00
Jeroen Bakker added 1 commit 2024-09-02 16:02:40 +02:00
Jeroen Bakker changed title from WIP: Preferences: GPU backend selection to Preferences: GPU backend selection 2024-09-03 08:54:50 +02:00
Jeroen Bakker requested review from Clément Foucault 2024-09-03 08:55:02 +02:00
Jeroen Bakker requested review from Julian Eisel 2024-09-03 08:55:20 +02:00
Jeroen Bakker added 1 commit 2024-09-03 08:58:16 +02:00
Jeroen Bakker added a new dependency 2024-09-03 09:40:30 +02:00
Jeroen Bakker removed a dependency 2024-09-03 09:41:00 +02:00
Jeroen Bakker added a new dependency 2024-09-03 09:41:33 +02:00
Clément Foucault requested changes 2024-09-03 11:42:14 +02:00
Dismissed
@ -2065,0 +2074,4 @@
uiLayout *col = uiLayoutColumn(layout, false);
uiItemL_ex(col, RPT_("Could not initialize Vulkan"), ICON_NONE, true, false);
uiItemL(col, RPT_(""), ICON_NONE);
uiItemL(col, RPT_("Blender running with OpenGL instead"), ICON_NONE);

Blender is now using OpenGL instead

But maybe ask @pablovazquez for best wording.

`Blender is now using OpenGL instead` But maybe ask @pablovazquez for best wording.
Jeroen-Bakker marked this conversation as resolved
@ -2065,0 +2075,4 @@
uiItemL_ex(col, RPT_("Could not initialize Vulkan"), ICON_NONE, true, false);
uiItemL(col, RPT_(""), ICON_NONE);
uiItemL(col, RPT_("Blender running with OpenGL instead"), ICON_NONE);
uiItemL(col, RPT_("Updating GPU drivers can improve compatibility"), ICON_NONE);

Missing final period . on all sentences.

Missing final period `.` on all sentences.
Author
Member

I don't mind adding them. Was just following the local style.

I don't mind adding them. Was just following the local style.
Jeroen Bakker requested review from Pablo Vazquez 2024-09-03 13:27:24 +02:00
Jeroen Bakker added 1 commit 2024-09-03 13:33:47 +02:00
Julian Eisel requested changes 2024-09-03 17:03:41 +02:00
Dismissed
Julian Eisel left a comment
Member

I think the language needs some tweaking.

For the preferences I'd suggest a UI like this:

[i] The Vulkan backend is experimental:

    * OpenXR and GPU subdivision are not supported
    * Expect reduced performance

To indent the bullet points you can use ICON_BLANK1 as icon. For the bullet point themselves use the \u2022 character.

For the popup:

Failed to load using Vulkan, using OpenGL instead.

Updating GPU drivers may solve this issue. The graphics backend can be changed
in the System section of the Preferences.
I think the language needs some tweaking. For the preferences I'd suggest a UI like this: ``` [i] The Vulkan backend is experimental: * OpenXR and GPU subdivision are not supported * Expect reduced performance ``` To indent the bullet points you can use `ICON_BLANK1` as icon. For the bullet point themselves use the `\u2022` character. For the popup: ``` Failed to load using Vulkan, using OpenGL instead. Updating GPU drivers may solve this issue. The graphics backend can be changed in the System section of the Preferences. ```
Julian Eisel reviewed 2024-09-03 17:09:40 +02:00
Julian Eisel left a comment
Member

Also, what is the "GPU Viewport"? Users are familiar with the "3D Viewport" but isn't this all UI drawing? Would propose "Graphics", or maybe "Display Graphics".

Also, what is the "GPU Viewport"? Users are familiar with the "3D Viewport" but isn't this all UI drawing? Would propose "Graphics", or maybe "Display Graphics".
Jeroen Bakker requested review from Clément Foucault 2024-09-05 08:26:00 +02:00
Jeroen Bakker requested review from Julian Eisel 2024-09-05 08:26:02 +02:00
Jeroen Bakker force-pushed vulkan/backend-selection from 6300231fbd to c9a8fcc55a 2024-09-05 08:28:03 +02:00 Compare
Clément Foucault approved these changes 2024-09-05 12:13:59 +02:00
Julian Eisel approved these changes 2024-09-05 15:49:17 +02:00
Author
Member

@blender-bot build

@blender-bot build
Jeroen Bakker added 1 commit 2024-09-06 07:47:30 +02:00
Fix compiler issue mac
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
4eb8c864d6
Author
Member

@blender-bot build

@blender-bot build
Jeroen Bakker merged commit 458faa6486 into main 2024-09-06 08:29:00 +02:00
Jeroen Bakker deleted branch vulkan/backend-selection 2024-09-06 08:29:03 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: blender/blender#126545
No description provided.