Bug 105320

Summary: Storage texel buffer access produces wrong results (RX Vega)
Product: Mesa Reporter: Józef Kucia <joseph.kucia>
Component: Drivers/Vulkan/radeonAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: libgradev
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Sample program

Description Józef Kucia 2018-03-01 23:12:51 UTC
Created attachment 137738 [details]
Sample program

The attached program produces wrong results:

Got value 3735928559, expected 8.
Got value 8, expected 7.
Comment 1 Bas Nieuwenhuizen 2018-03-04 15:59:29 UTC
Hi,

On which GPUs did you have this issue?

On Vega this suffers from a bug with buffers sizes, where if you use a buffer view with constant index, the HW interprets the number of elements as the number of bytes. As the example allocates buffers of size 4, and hence 1 elements, this means that all the accesses in the shader fail.

This is a radv/LLVM bug and we're working on fixing it. https://patchwork.freedesktop.org/patch/205590/ was a proposed fix, but causes other regressions.

However it seems to work for me on Polaris. I'd appreciate if you can tell whether you've seen the issue for pre-vega as well and that I hence need to look deeper there.

Thanks,
Bas
Comment 2 Józef Kucia 2018-03-04 16:50:24 UTC
Yes, the issue is RX Vega specific.
Comment 3 Samuel Pitoiset 2018-03-29 08:08:01 UTC
This should be fixed with https://cgit.freedesktop.org/mesa/mesa/commit/?id=4503ff760c794c3bb15b978a47c530037d56498e

Note that it's a workaround because we are waiting for a proper LLVM fix (Bas has one but it hasn't been pushed yet).

Thanks for the report Jozef.
Comment 4 Józef Kucia 2018-04-10 22:00:32 UTC
(In reply to Samuel Pitoiset from comment #3)
> This should be fixed with
> https://cgit.freedesktop.org/mesa/mesa/commit/
> ?id=4503ff760c794c3bb15b978a47c530037d56498e

The attached sample program still doesn't work.

17.3-branchpoint-4586-g0babc8e5d665
Comment 5 Bas Nieuwenhuizen 2018-04-15 22:02:07 UTC
You are right, seems I missed atomics in the fix.
Comment 6 Samuel Pitoiset 2018-04-17 19:53:59 UTC
Does it work now with https://cgit.freedesktop.org/mesa/mesa/commit/?id=b0e3a9b19f16ed1ce4c1f150718b0c0f0e6111f6 ?
Comment 7 Bas Nieuwenhuizen 2018-04-18 21:05:49 UTC
This should be fixed, the provided program works on my Raven now (and did not before the second fix).

It will be included in 18.0.2.
Comment 8 Józef Kucia 2018-04-19 06:30:23 UTC
(In reply to Samuel Pitoiset from comment #6)
> Does it work now with
> https://cgit.freedesktop.org/mesa/mesa/commit/
> ?id=b0e3a9b19f16ed1ce4c1f150718b0c0f0e6111f6 ?
Yes, it works great. Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.