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

vk_ext_transform_feedback & VK_EXT_SAMPLER_FILTER_MINMAX broken on GCN POLARIS #251

Closed
RinMaru opened this issue Aug 31, 2021 · 22 comments
Closed

Comments

@RinMaru
Copy link

@RinMaru RinMaru commented Aug 31, 2021

01002da013484000_2021-08-26_22-05-42-969

VK_EXT_SAMPLER_FILTER_MINMAX broken on Windows but working on LINUX open source drivers

0100c1f0051b6000_2021-08-23_21-13-02-866

Transform Feedback broken

@iMonZ
Copy link

@iMonZ iMonZ commented Aug 31, 2021

+1

@jinjianrong
Copy link
Member

@jinjianrong jinjianrong commented Sep 9, 2021

@RinMaru could you provide a Renderdoc trace for us to reproduce the issue? could you provide two images to show the issue: one with VK_EXT_SAMPLER_FILTER_MINMAX broken and one with VK_EXT_SAMPLER_FILTER_MINMAX working?

@RinMaru RinMaru closed this Sep 9, 2021
@RinMaru RinMaru reopened this Sep 9, 2021
@RinMaru
Copy link
Author

@RinMaru RinMaru commented Sep 9, 2021

Since I have no clue of anything that uses the extension outside an emulator I can't test. If there's a tool to test the offending extension then I'll use it Otherwise I guess I'll close this

@RinMaru RinMaru closed this Sep 9, 2021
@perlfu
Copy link
Collaborator

@perlfu perlfu commented Sep 9, 2021

@RinMaru which emulator do you see the issue on? Yuzu?

@RinMaru
Copy link
Author

@RinMaru RinMaru commented Sep 9, 2021

@RinMaru which emulator do you see the issue on? Yuzu?

Yes. Since then the sampler ext has been disabled as a workaround. Transform feedback is still an issue though.
https://discord.gg/yuzu-emu
the devs may be able to help you with a way to showcase the issue

@RinMaru RinMaru reopened this Sep 9, 2021
@FernandoS27
Copy link

@FernandoS27 FernandoS27 commented Sep 11, 2021

@jinjianrong Hi I'm a yuzu developer. We have prepared a test example https://drive.google.com/file/d/1oTUR3evy49TiBYC2dpNyRMSPhZCE7m89/view?usp=sharing

it has a renderdoc capture done on windows(since you guys share some codebase) and a homebrew we wrote. You can test it with our emulator: https://github.com/yuzu-emu/yuzu-mainline/releases if you need an exact linux capture.

If you want I can send you an Intel/NVIDIA example so you have a reference solution.

About VK_EXT_SAMPLER_FILTER_MINMAX. We use nouveau and deko3d to produce homebrew for Switch, I don't think I have the option there for this feature and I can't provide a capture from a game as that contains copyright material. In general, it's broken in GCN 4, 3, 2, 1 on Windows proprietary driver and RADV/Mesa.

EDIT: As a side note, I need to debug a TDR on AMD GPUs. It happens on every AMD GPU, every driver. I tried Radeon Profiler but didn't help, What's the best way to debug this?

@Flakebi
Copy link
Member

@Flakebi Flakebi commented Sep 14, 2021

I need to debug a TDR on AMD GPUs.

umr can be used for debugging (ssh into the hanging machine and run umr).
umr -t gives an overview over the hardware blocks, although only with cryptic acronyms.

If a shader is hanging, umr -O bits,disasm_anyways --waves gfx_0.0.0 --gfxoff 0 can be used to show the currently executed instruction. In the case of a segfault, it usually hangs at a s_waitcnt.

People in the #dri-devel irc channel on freenode can probably help more with debugging hangs (on linux).

@jinjianrong
Copy link
Member

@jinjianrong jinjianrong commented Sep 16, 2021

@FernandoS27 what GPU do you use to capture the renderdoc trace? what issue are you seeing with the trace? This is not for the VK_EXT_SAMPLER_FILTER_MINMAX issue, right?

@FernandoS27
Copy link

@FernandoS27 FernandoS27 commented Sep 16, 2021

@FernandoS27 what GPU do you use to capture the renderdoc trace? what issue are you seeing with the trace? This is not for the VK_EXT_SAMPLER_FILTER_MINMAX issue, right?

I captured using an RX 6800M - windows 10, I can also provide Vega and GCN4(RX 570) Captures if needed as well as Linux captures. In general, transform feedback doesn't seem to write anything. The capture is a particle emitter, it should generate a bunch of falling particles.

about the VK_EXT_SAMPLER_FILTER_MINMAX , I'll see how I can make a test. I may have to make one outside of emu (meaning writing all the Vulkan boilerplate code sight). I'll make an issue myself when I have a reproducible test for that.

@FernandoS27
Copy link

@FernandoS27 FernandoS27 commented Sep 16, 2021

Here#s a capture in RADV (Mesa) where Transform feedback works: https://drive.google.com/file/d/1ydXnxOwQJ0wDNefyWr_AIhjeCqsgINYn/view?usp=sharing

Same GPU: RX 6800M, Ubuntu 21.04

@jinjianrong
Copy link
Member

@jinjianrong jinjianrong commented Sep 17, 2021

@FernandoS27 we are seeing VK_ERROR_OUT_OF_HOST_MEMORY error message when open the renderdoc trace in https://drive.google.com/file/d/1oTUR3evy49TiBYC2dpNyRMSPhZCE7m89/view?usp=sharing. I assume this is the issue mentioned in #253. Could you provide a renderdoc trace without this issue? Also what version of Windows driver are you using?

@FernandoS27
Copy link

@FernandoS27 FernandoS27 commented Sep 17, 2021

@FernandoS27 we are seeing VK_ERROR_OUT_OF_HOST_MEMORY error message when open the renderdoc trace in https://drive.google.com/file/d/1oTUR3evy49TiBYC2dpNyRMSPhZCE7m89/view?usp=sharing. I assume this is the issue mentioned in #253. Could you provide a renderdoc trace without this issue? Also what version of Windows driver are you using?

Here you go https://drive.google.com/file/d/17x_8cyaJuzRuyw9u-WVoB3WeQiMB4wJY/view?usp=sharing Same OS: windows, Same GPU RX 6800M

@RinMaru
Copy link
Author

@RinMaru RinMaru commented Oct 5, 2021

This is still broke in Newest Driver 21.10.1 (Transform feedback)

@jinjianrong
Copy link
Member

@jinjianrong jinjianrong commented Oct 22, 2021

@FernandoS27 We got similar render image with Windows and Radv driver for the trace https://drive.google.com/file/d/17x_8cyaJuzRuyw9u-WVoB3WeQiMB4wJY/view?usp=sharing :
image

Could you confirm if the image is correct? if not, could you provide the expected image?

@FernandoS27
Copy link

@FernandoS27 FernandoS27 commented Oct 22, 2021

@jinjianrong looks wrong. I can't get a capture from RADv right now (i'll do it at night) but I have a capture of NVIDIA GTX 1650, Intel 650HD and AMD RX 570 all at the same frame.

New Captures

It should look similar to this (except black bl\ackground and the spread does not have to be the same, it differs in Intel and NVIDIA a bit due to timing, I timed 150 frames this time, so it should be spread in AMD after fix)
TF_Result

Here a few things we always do that are different to most people:
vkCmdBeginTransformFeedbackEXT(cmd_list, 0, 0, nullptr, nullptr):
same story for vkCmdEndTransformFeedbackEXT(cmd_list, 0, 0, nullptr, nullptr):

This is fine according to the Spec

we don't emulate counters yet, nor are they necessary in the specification.

Other than that, we never change or set the streambuffer a, according to the spec this means we always use the stream 0. I also tried changing it, as well as adding full barriers between the transform feedback calls and no use.

@FernandoS27
Copy link

@FernandoS27 FernandoS27 commented Dec 16, 2021

@jinjianrong It seems to be fixed on latest amdvlk version. I still need further confirmation.

@FernandoS27
Copy link

@FernandoS27 FernandoS27 commented Dec 16, 2021

image
I can confirm now. Feel free to close this issue.

@jinjianrong
Copy link
Member

@jinjianrong jinjianrong commented Dec 16, 2021

Thanks for the confirm

@FernandoS27
Copy link

@FernandoS27 FernandoS27 commented Jan 20, 2022

@jinjianrong as far as I know Windows AMD proprietary driver uses AMDVLK, right? Is there any way to know which version of it is used? January's Windows driver releases have not included this fix yet. So I'm not sure if AMDVLK has not been updated there or the bug happens on windows for some reason.

@jinjianrong
Copy link
Member

@jinjianrong jinjianrong commented Jan 27, 2022

@jinjianrong
Copy link
Member

@jinjianrong jinjianrong commented Jan 27, 2022

Btw, you could use vulkaninfo to get driverVersion (refer to #262) to check if a Windows driver and an AMDVLK driver are built from similar code base.

@FernandoS27
Copy link

@FernandoS27 FernandoS27 commented Jan 27, 2022

@jinjianrong i have checked up that driver and transform feedback is still broken in Windows. I had checked Linux about 2 weeks ago and TFB was still working.

This is our own report from Vulkan VkPhysicalDeviceProperties

[  10.479230] Render.Vulkan <Info> video_core\renderer_vulkan\renderer_vulkan.cpp:Report:186: Driver: AMD proprietary driver 2.0.213
[  10.479233] Render.Vulkan <Info> video_core\renderer_vulkan\renderer_vulkan.cpp:Report:187: Driver Version: 2.0.213
[  10.479234] Render.Vulkan <Info> video_core\renderer_vulkan\renderer_vulkan.cpp:Report:188: Device: Radeon RX 570 Series
[  10.479235] Render.Vulkan <Info> video_core\renderer_vulkan\renderer_vulkan.cpp:Report:189: Vulkan: 1.3.203

Not single TFB test passed.

I'll test Vega and RDNA2 later on.

EDIT: Same story with Vega and RDNA2.
EDIT: We figured out a bug on our end for Windows, ignore the rest of the message. I would, however, love to ask where do I point out a bug that was not reported by Vulkan Validation layers?

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

No branches or pull requests

6 participants