Is there any reason why we need a separate issue for this?
Less wasteful memory management was an actual feature in 2.5, I don't really see how this is a bad thing and why it would make Intel (and only Intel) run that much worse.
I don't really see how this is a bad thing and why it would make Intel (and only Intel) run that much worse.
That’s a fair question, and it’s something I’ve been asking myself as well, " why this seems to affect Intel specifically ? ".
Part of me wonders whether this could be related to the shared-memory nature of older Intel iGPUs, which do not have dedicated VRAM and instead rely entirely on system memory. In that context, the memory management strategy might end up having a negative performance impact rather than an improvement.
If the introduced feature, less wasteful memory management results in a consistent performance drop on Intel iGPUs, I was wondering whether it might still be worth investigating why this behavior appears to impact Intel GPUs in particular, even if the change itself is intentional.
To rule out this being game-specific, I tested a few additional titles and observed the same behavior across them.
While a 1–2 FPS difference wouldn’t be a concern, the performance drop I’m seeing is closer to 7–10 FPS, which has a noticeable impact on overall performance,and especially on an integrated GPU this makes the impact much more noticeable.
I mean, yeah, but what are we supposed to do here?
If the change in memory management is causing perf problems then the best thing I can really do here is recommend to stick to 2.4.1 on Intel IGPs until someone figures out what's going on. "Just use more memory lol" isn't really an option, and there is no good reason for this to be a problem in the first place.
Greetings, @VigneshR387
You can try to disable memory defragmentation in DXVK by adding config option dxvk.enableMemoryDefrag = False to dxvk.conf config file or DXVK_CONFIG environment variable.
Also, you can check, if d3d11.cachedDynamicResources = a and d3d9.cachedDynamicBuffers = True have any effect.
Link with information about Vulkan Memory Types and memory management on different GPU vendors (including Intel iGPUs with Intel(R) UHD Graphics 600 as an example) authored by Adam Sawicki, which explains why these actions may help in your situation: https://asawicki.info/news_1740_vulkan_memory_types_on_pc_and_how_to_use_them
Hey @Digger1955, thanks for the advice.
You can try to disable memory defragmentation in DXVK by adding config option
dxvk.enableMemoryDefrag = Falsetodxvk.confconfig file orDXVK_CONFIGenvironment variable.
Isn't Memory Defragmentation is disabled by default on Intel ANV drivers? link
Also, you can check, if
d3d11.cachedDynamicResources = aandd3d9.cachedDynamicBuffers = Truehave any effect.
I tried setting these options in dxvk.conf but didn't see any noticable difference.
Whats confusing me is that the memory heap reported and budgeted by Vulkan is actually pretty sufficient
info: Memory:
info: Heap 0: 8.68 GiB (DEVICE_LOCAL)
info: Budget: 6.86 GiB
info: Type 0: DEVICE_LOCAL
info: Type 1: DEVICE_LOCAL | HOST_VISIBLE | HOST_COHERENT
info: Type 2: DEVICE_LOCAL | HOST_VISIBLE | HOST_COHERENT | HOST_CACHED
info: Type 3: DEVICE_LOCAL
info: Type 4: DEVICE_LOCAL | HOST_VISIBLE | HOST_COHERENT
info: Type 5: DEVICE_LOCAL | HOST_VISIBLE | HOST_COHERENT | HOST_CACHED
Logs for reference:
dxvk 2.4.1 log.txt
dxvk 2.7.1 log.txt
I’m not entirely sure how DXVK utilizes the video memory heap exposed via VK_EXT_memory_budget internally.
As @doitsujin mentioned earlier, increasing the vidememory heap shoudn't be reallly affecting the performance but somehow thats the case here.
One thing i like to point out is that if you look at these two screenshots:
I'm not sure whether the circled one's are the actual vram usage. If so, it's clearly being underutilized in 2.7.1 compared to 2.4.1. Which may explain the lower performance. Again, I might be wrong here.
Things would be alot easier, If users with similiar GPU as mine could chime in to confirm whether the issue really exist in the first place.
@VigneshR387
Isn't Memory Defragmentation is disabled by default on Intel ANV drivers? link
On Linux with MESA-ANV drivers, on devices that have minSubgroupSize >= 16 - yes, commit link.
If you have Windows, you can check the behaviour there. If the behaviour will be different it may point to a problem in Linux driver stack, if not - then it is Intel-specific (hardware/software).
As a workaround to conceal the problem, you may enable preffered FPS Limiter with FPS limit value that you hit in any case (30 FPS, for example, in your images).
Was the lower perf actually root caused to memory allocation?
Because there might be a bunch more changes between 2.6.2 & 2.4.1 versions.
Was the lower perf actually root caused to memory allocation?
Maybe. But the performance difference is between 2.4.1 and 2.5 (I forgot to change the tile). Based on the release note in 2.5
Was the lower perf actually root caused to memory allocation?
Maybe. But the performance difference is between 2.4.1 and 2.5 (I forgot to change the tile). Based on the release note in 2.5
But if dxvk.enableMemoryDefrag is disabled on Intel/Anv, then it might be another change that trigger this regression.
then it might be another change that trigger this regression.
Yeah, you’re right. After bisecting between DXVK 2.4.1 (good) and 2.5 (bad), the regression points to this specific commit:
af4ec3c63d65da50ca8be6fd65a031b3301b979b
Testing immediately before and after this commit shows reproducible performance regression.
So the regression seems to only affect D3D11 titles. The game I’ve currently tested this on is Divinity: Original Sin – Enhanced Edition.
@doitsujin Any thoughts on this?
Yeah GENERAL on anything prior to DG2 I think will get sideband compression disabled.
The DxvkImageView::pickLayout() added in that commit would return GENERAL for images that are configured to have GENERAL as their common layout. Back then that would've only been the case for images that can also be bound as storage image or images that cannot be rendered to.
https://github.com/doitsujin/dxvk/blob/af4ec3c63d65da50ca8be6fd65a031b3301b979b/src/d3d11/d3d11_texture.cpp#L731-L761
The original issue is about a D3D9 game and render targets in that one certainly won't have USAGE_STORAGE_BIT.
That commit is outdated anyway. (e20407d61d2ea9472be4578eec53c51a2a378dcc)
Nowadays there isn't an additional image layout that gets passed down from the frontend when binding attachments.
As the commit message says, it just gets the image layout from the DxvkImageView object.
When creating a D3D11RenderTargetView, DXVK creates such a DxvkImageView object with COLOR_ATTACHMENT_OPTIMAL as the layout.
The D3D9 frontend creates those DxvkImageViews for rendering with COLOR_ATTACHMENT_OPTIMAL as well.
So it shouldn't ever render to GENERAL and compression should be fine (?).
You could print out the layouts used in the driver in :
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/intel/vulkan/genX_cmd_buffer.c?ref_type=heads#L6120 (color attachment)
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/intel/vulkan/genX_cmd_buffer.c?ref_type=heads#L6311 (depth attachment)
And see if you see different values before/after the DXVK change.
I added logging in DXVK (I don't have an Intel GPU).
When replaying my Assassins Creed 2 apitrace (that's the game from the original issue), I never got any layout other than COLOR_ATTACHMENT_OPTIMAL or VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL. (DXVK master)
Though admittedly I only added logging for actual DXVK render passes and not for things like e.g. meta blit render passes.
You could print out the layouts used in the driver in :
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/intel/vulkan/genX_cmd_buffer.c?ref_type=heads#L6120 (color attachment)
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/intel/vulkan/genX_cmd_buffer.c?ref_type=heads#L6311 (depth attachment)
And see if you see different values before/after the DXVK change.
Just to confirm, should I be building Mesa from source and adding the logging you suggested? If you have any references for building Mesa, that would be helpful.
I added logging in DXVK (I don't have an Intel GPU).
When replaying my Assassins Creed 2 apitrace (that's the game from the original issue), I never got any layout other than
COLOR_ATTACHMENT_OPTIMALorVK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL. (DXVK master)Though admittedly I only added logging for actual DXVK render passes and not for things like e.g. meta blit render passes.
Just to clarify, this regression appears to only affect D3D11 titles; DX9 paths seem unaffected. Apologies for the earlier confusion around AC2.
Can you name some D3D11 titles that are affected?
Can you name some D3D11 titles that are affected?
The one i just tested now was "Divinity Original Sin Enhanced Edition".
Also had the same issue with Hitman Absolution.
Is the latest DXVK still affected? There have been some major changes to how it handles image layouts of render targets.
You can find a build here: https://github.com/doitsujin/dxvk/actions/runs/20706111823 ('artifacts')
[..] images that are configured to have GENERAL as their common layout. Back then that would've only been the case for images that can also be bound as storage image [..]
That can actually happen with d3d11 games.
Is the latest DXVK still affected?
Tested till v2.7.1. I'll try with the latest build and let you know 👍.
Is the latest DXVK still affected? There have been some major changes to how it handles image layouts of render targets.
You can find a build here: https://github.com/doitsujin/dxvk/actions/runs/20706111823 ('artifacts')
[..] images that are configured to have GENERAL as their common layout. Back then that would've only been the case for images that can also be bound as storage image [..]
That can actually happen with d3d11 games.
On older GPUs Anv performs decompression on layout transition so that the storage operation is performed on uncompressed data (since HW cannot access compressed data for storage).
So if you switched from color_attachment_optimal to general that would prevent compressed writes from fragment writes to happen.
Xe2 and DG2 GPUs are not affected by this since HW gained compression support for storage.
You could print out the layouts used in the driver in :
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/intel/vulkan/genX_cmd_buffer.c?ref_type=heads#L6120 (color attachment)
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/intel/vulkan/genX_cmd_buffer.c?ref_type=heads#L6311 (depth attachment)
And see if you see different values before/after the DXVK change.
@llandwerlin-intel @K0bin
So i added the print statement as you suggested.
src/intel/vulkan/genX_cmd_buffer.c :
gfx->color_att[i].vk_format = iview->vk.format;
gfx->color_att[i].iview = iview;
fprintf(stderr,
"ANV color attachment %u: layout=%d aux_usage=%d\n",
i,
att->imageLayout,
aux_usage);
gfx->color_att[i].layout = att->imageLayout;
gfx->color_att[i].aux_usage = aux_usage;
gfx->color_att[i].skip_srgb_decode = att_flags_info &&
&
if (d_att != NULL && d_att->imageView != VK_NULL_HANDLE) {
d_iview = anv_image_view_from_handle(d_att->imageView);
initial_depth_layout = attachment_initial_layout(d_att);
depth_layout = d_att->imageLayout;
depth_aux_usage =
anv_layout_to_aux_usage(cmd_buffer->device->info,
d_iview->image,
VK_IMAGE_ASPECT_DEPTH_BIT,
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
depth_layout,
cmd_buffer->queue_family->queueFlags);
fprintf(stderr,
"ANV depth attachment: layout=%d aux_usage=%d\n",
depth_layout,
depth_aux_usage);
clear_value.depth = d_att->clearValue.depthStencil.depth;
}
Build flags & Setup:
> meson setup builddir -Dvulkan-drivers=intel -Dgallium-drivers= -Dbuildtype=debug
>meson compile -C builddir
>meson devenv -C builddir
>lutris
Here's the log:
https://privatebin.rinuploads.org/?b1993b60b694bf9c#DMhHpTFJMDtPwJ3wxSSwkhp8M5hdsjczc1SyUcS53txd
https://privatebin.rinuploads.org/?2fa12560e428ec46#24mSW9zc33oHDKRsc8mkR12RHReu7EgsmejYb8Jma6T8
https://privatebin.rinuploads.org/?956ad9ab8cb236b8#2ZrLdcMSE5BFvrwiJ5JyEu9NAuotgadmSMto2PmaLrBg
The 2.4.1 log has 121,731 lines and 2380 hits for layout=1.
The 2.5 log has 48,755 lines and 12,475 hits for layout=1.
The 2.7.1 log has 54,242 lines and 14,213 hits for layout=1.
So the old 2.4.1 log has more than 2x as many lines but roughly a sixth the number of hits for layout=1.
That's too significant to be explained by randomness across tests or by a difference in how long your test runs were.
Seems like we end up with LAYOUT_GENERAL render targets on newer DXVK versions.
@VigneshR387 Thank you, that has already been very helpful!
It would be great if you could also make an apitrace of that test run.
Here's a guide for how to do that: https://github.com/doitsujin/dxvk/wiki/Using-Apitrace
So the old 2.4.1 log has more than 2x as many lines but roughly a sixth the number of hits for
layout=1.
The initial run was on v2.4.1, and I let the game run a bit longer compared to 2.5 and 2.7.1, which likely explains why that log has roughly 2× more lines 😅 .
It would be great if you could also make an apitrace of that test run.
Sure, I'll capture the api trace for all 3 test runs .
Sure, I'll capture the api trace for all 3 test runs .
That's not necessary. It saves the D3D11 commands that the game makes and the game doesn't know or care what DXVK does internally so the commands would be the same in all 3 test runs.
Don't waste your time. Just make 1 good apitrace.
@K0bin
Here's the api trace for "Divinity: Original Sin Enhanced Edition".
The api trace was captured using WineD3D (Wine 10.20)
https://drive.google.com/file/d/17Xp7LISMuoqPUyoHcrhGjM17FAihVF5a/view?usp=sharing
I tried capturing the api trace by running the game with DXVK+Wine 10.20 but it seems to instantly crash when launched with this error:
apitrace: warning: caught exception 0xc0000005
apitrace: flushing trace
wine: Unhandled page fault on read access to FFFFFFFFFFFFFFFF at address 00006FFFF8F7EB9B (thread 0024), starting debugger...
0154:fixme:dbghelp:elf_search_auxv can't find symbol in module
0154:fixme:dbghelp:elf_search_auxv can't find symbol in module
apitrace: warning: caught exception 0xc0000005
apitrace: flushing trace
Monitored process exited.
This results in a 3 Byte trace file.
So i went with the WineD3D+Wine route as suggested in the wiki and was able to run the game without any crashes.
Please let me know if you need anything else from my side.
I have this problem (performance degradation) on winlator emulator via dxvk above 2.4 on Snapdragon elite android device. but I can't use 2.4.1 as it doesn't work with turnip drivers
DXVK_CONFIGx2 2025-120xc0000005x1 2026-01
I'm following up on my earlier issue [#5353](https://github.com/doitsujin/dxvk/issues/5353) about the random FPS drops I've been experiencing. While digging into that problem, I stumbled across something else that seems worth mentioning separately.
I've noticed that DXVK versions 2.6.2 and later have lower vidmem heap allocation compared to 2.4.1 or older releases. I do see noticeable improvement in performance when it allocates more video memory heap (around 7-8 FPS gain), and unlike my last issue, I'm able to reproduce this consistently.
Software Information
System Information