[PATCH] D40047: AMDGPU/GCN: Remove xnack from 801 and 810

Marek Olšák via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 08:16:03 PST 2017


mareko added a comment.

In https://reviews.llvm.org/D40047#927092, @t-tye wrote:

> In https://reviews.llvm.org/D40047#927005, @mareko wrote:
>
> > In https://reviews.llvm.org/D40047#926553, @t-tye wrote:
> >
> > > Did notice that for Mesa3D XNACK is being forcibly disabled for all targets <gfx9 and forcibly enabled for all targets >=gfx9. Is that the best choice? It seems it will likely not match how the driver is configuring the hardware. For example, how does the driver configure the APUs? Is XNACK always being enabled for gfx9 (it is not for compute)?
> >
> >
> > Mesa can't modify SH_MEM_CONFIG to enable/disable XNACK. What is hardcoded in the kernel is what we get. XNACK is only enabled on compute rings on gfx8 APUs and on all rings on gfx9. In practice, Mesa should never access an unmapped page. I don't know if setting -xnack on all chips is a good idea in that case. We might also have suboptimal performance on gfx9 due to XNACK being always enabled by the KMD.
>
>
> If Mesa always guarantees that the shaders will never access non-resident memory, and so will never have an XNACK, then it can always generate shaders that have XNACK disabled regardless of whether the kernel enables XNACK replay. In other words, enabling XNACK replay does not affect performance unless the shader chooses to generate XNACK compatible code. And the shader does not need to generate XNACK compatible code if it will never access a non-resident page.
>
> For example, OpenCL 1.2 runtime always ensures all buffers are resident, and so compilers all shaders with XNACK disabled, regardless of whther the kernel has enabled XNACK replay.
>
> So, does Mesa runtime always ensure all data accessed will be resident? Even for APUs? If so it would likely be a performance gain to always request no-XNACK unless page migration may also be active on the data accessed.


Actually not always. We support partially-resident buffers. If those cause an infinite replay loop, I think we have to disable replay in the KMD. I don't know if no-XNACK is OK for partially-resident buffers.


https://reviews.llvm.org/D40047





More information about the llvm-commits mailing list