[Mesa-dev] [Bug 111004] memcpy accessing GPU memory mappings using SSE instructions breaks in KVM

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jun 27 09:05:55 UTC 2019


https://bugs.freedesktop.org/show_bug.cgi?id=111004

--- Comment #11 from maxamar at mail.ru ---
(In reply to Christian König from comment #10)
> Sorry but this is not a bug at all.
> 
> As Michel already noted core Vulkan as well as some OpenGL/OpenCL extensions
> mandate that the platform support all well aligned memory accesses to GPU
> local memory (VRAM).
> 
> If your platform (KVM in this case) can't do this for some reason you simply
> can't use that platform with this software.
> 
> In other words even if you replace memcpy/memset in Mesa with custom non SSE
> versions it is perfectly valid for an application to use SSE to access VRAM.
> And you can't change a binary application (which is actually just conforming
> to a standard).
> 
> The only possible workaround I can see in the driver is to not use VRAM at
> all for CPU mappings. That's actually rather easily doable, but would
> potentially cripple performance quite a bit.
> 
> I can point you to the necessary bits of code if you are interested in that.

Yes and somehow Mesa uses "movups" instruction which is:
MOVUPS-Move Unaligned Packed Single-Precision Floating-Point

So is a bug.

Correct version is movaps which copies aligned data (is supported in KVM since
long ago).

Yes it is in glibc and what's so - don't use it then.

KVM is part of Linux so must be supported.

Anyway upgrading kernel to 4.17 seems to solve the problem, needs a test.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190627/c0faa75e/attachment.html>


More information about the mesa-dev mailing list