Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable AMD switchable graphics on Windows with Vulkan to fix driver issue #73450

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Feb 16, 2023

This is a required workaround on setups with AMD integrated graphics + NVIDIA dedicated GPU to be able to start the engine with the Forward+ or Forward Mobile rendering methods.

While a AMD driver update can resolve this issue, it still gets reported regularly and is likely to become a source of support headache for people distributing projects made with Godot (as this also affects exported projects).

The only case where disabling integrated graphics is really a problem is for non-game applications, but these are likely to use OpenGL anyway due to the lower rendering base cost and system requirements.

Please test, as I have no setup to test this locally. This targets a merge for 4.1 with a backport to 4.0.x.

Windows 64-bit editor binary for testing this PR: https://0x0.st/HrFk.exe.zip (link expires in late 2023)

Older build

Windows 64-bit editor binary for testing this PR: https://0x0.st/HrGR.exe.zip (link expires in late 2023)

…issue

This is a required workaround on setups with AMD integrated graphics
+ NVIDIA dedicated GPU to be able to start the engine with the Forward+
or Forward Mobile rendering methods.

While a AMD driver update can resolve this issue, it still gets reported
regularly and is likely to become a source of support headache for people
distributing projects made with Godot (as this also affects exported projects).
@lmurray
Copy link

lmurray commented Feb 16, 2023

This could probably be moved into the Windows Vulkan context itself so it doesn't affect other drivers such as D3D12.

This workaround is not needed for rendering drivers other than Vulkan.
@Calinou
Copy link
Member Author

Calinou commented Feb 17, 2023

This could probably be moved into the Windows Vulkan context itself so it doesn't affect other drivers such as D3D12.

I've pushed a second commit with an updated Windows build in OP for testing.

@RobertBeckebans
Copy link

Nvidia's NVRHI / donut checks with the Vulkan API for dedicated GPUs as an alternative to set a environment variable:
if (prop.deviceType == vk::PhysicalDeviceType::eDiscreteGpu)

See https://github.com/NVIDIAGameWorks/donut/blob/7ecdf8899fee34a8138417a6b00239bcb308716d/src/app/vulkan/DeviceManager_VK.cpp#L559

@Wuyou55
Copy link

Wuyou55 commented Mar 1, 2023

AMD R7 + 2060(note books) This PR can be used.
thx.

@livolickie
Copy link

livolickie commented Mar 1, 2023

Working on R7 3750H (RX Vega 10) + GTX 1650 Mobile (Laptop)

@Calinou
Copy link
Member Author

Calinou commented Mar 1, 2023

Nvidia's NVRHI / donut checks with the Vulkan API for dedicated GPUs as an alternative to set a environment variable:
if (prop.deviceType == vk::PhysicalDeviceType::eDiscreteGpu)

See NVIDIAGameWorks/donut@7ecdf88/src/app/vulkan/DeviceManager_VK.cpp#L559

This is interesting, but we only need to disable AMD switchable graphics, as Intel switchable graphics seem to work just fine.

@MonT97
Copy link

MonT97 commented Mar 1, 2023

Working in a ryzen7 4800H with an integrated and a GTX 1650 (driver v522.25) laptop

graphic adapter windows graphic settings is not set (the program isn't added)

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love having to include a hack like this. But it seems well tested and appropriately limited to the windows platform, so lets go ahead and merge

@akien-mga
Copy link
Member

Doesn't this mean that we'd never use AMD discrete GPUs when available?

@clayjohn
Copy link
Member

clayjohn commented May 23, 2023

Doesn't this mean that we'd never use AMD discrete GPUs when available?

I think it means we would never use the AMD integrated GPU when a dedicated GPU is available

Nevermind setting DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1 just ensures that the driver exposes the two GPUs as two different GPUs instead of exposing them as a single GPU

@akien-mga akien-mga merged commit 774f4a7 into godotengine:master May 24, 2023
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the windows-vulkan-disable-amd-switchable-graphics branch May 24, 2023 09:40
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.0.4.

@MarouanDoulahiane
Copy link

ERROR: vkCreateComputePipelines failed with error -1000012000.
at: (drivers/vulkan/rendering_device_vulkan.cpp:6522)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants