Created attachment 185445 [details] Part 1 (Mesa 17.2) - Build anv and radv
Yay! Got the demo cube spinning on my RX 480! (as I mentioned in 220982, OpenGL/Xorg doesn't work for me on 17.2.0, so I currently have 17.1.7 and ONLY Vulkan and VDPAU from the 17.2.0 build) vulkaninfo output: https://gist.github.com/myfreeweb/eca206a059eb396ec23c47f211ddbe58 My WIP patch for the Vulkan ICD loader and stuff: https://github.com/myfreeweb/Vulkan-LoaderAndValidationLayers/tree/freebsd (validation layers don't compile yet) On Intel Haswell, it doesn't work, just says that the implementation is incomplete for Haswell.
With the properly built 17.2.0 packages, the Dolphin Emulator successfully plays The Legend of Zelda: The Wind Waker on Vulkan with the RADV driver! This is the year of FreeBSD on the desktop :D https://i.imgur.com/kJgyAX2.jpg
I made ports for the Vulkan loader and stuff: bug 222175
anv (intel) fails vkEnumeratePhysicalDevices due to lack of build-id, mistakenly removed in v0 of the patch. However, vkCreateDevice requires DRM_IOCTL_I915_GEM_USERPTR which is broken. https://github.com/FreeBSDDesktop/freebsd-base-graphics/issues/132
Created attachment 186578 [details] Part 1 (Mesa 17.2) - Build anv and radv
Created attachment 186579 [details] Part 1 (Mesa 17.1) - Build anv and radv
I wonder, if radv is limited to drm-next or would work on FreeBSD releases. Mesa 17.2 version was build-tested together bug 221540. Mesa 17.1 version testing was less fancy, only on 10.3 i386/amd64, 11.0 i386/amd64, 11.1 i386/amd64, 12.0 i386/amd64/armv6/aarch6. This can probably land under maintainer timeout given low risk for existing drivers. However, there's no rush before bug 222175 lands.
Created attachment 186610 [details] [don't land] anv hacks for Mesa 17.2 Let's try unsynchronized userptr (requires root). Here's my vulkaninfo output: http://sprunge.us/fWUU cube demo works (sometimes) but rpcs3 hangs. Not very promising. ;\
I discovered something! To make Vulkan work on Wayland, --with-platforms=x11,drm,wayland needs to be added to mesa-dri too, not just mesa-libs. It enables the VK_KHR_wayland_surface extension in the drivers.
Created attachment 187400 [details] Part 1 (Mesa 17.3) - Build anv and radv
Created attachment 187401 [details] [dont'land] anv hacks for Mesa 17.3
Created attachment 187404 [details] Part 2 - Add WAYLAND option Here's an extra patch that adds a WAYLAND option to mesa-dri, which enables building the VK_KHR_wayland_surface extension in Vulkan drivers. BTW, got the cube demo and vulkaninfo working on my Haswell laptop. But only after launching them as root.
Created attachment 188519 [details] Part 1 (Mesa 17.3) - Build anv and radv
(In reply to Jan Beich from comment #13) Just noticed: > Partially implement memfd_create() via mkostemp() We have shm_open(SHM_ANON) for that! memfd is literally SHM_ANON but as a separate syscall because Linux likes making things look complex :) > ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako I think 2.7 is required here? (Or was that not Mesa…) The new flavors feature can help with that.
Created attachment 188635 [details] Part 1 (Mesa 17.3) - Build anv and radv (In reply to Greg V from comment #14) Like this?
(In reply to Jan Beich from comment #15) Yeah, looks good to me.
Looking at this.
There is a lot of patches in this PR. It would be extremely helpful if you could consolidate the patches and mark any obsoleted patches as such. Thank you!
Comment on attachment 186579 [details] Part 1 (Mesa 17.1) - Build anv and radv Obsolete after ports r451657.
Created attachment 188666 [details] Part 1 (Mesa 17.2) - Build anv and radv Changes since previous version: - Rebase - Use SHM_ANON per comment 14 - Prepare for bug 214864
Created attachment 188667 [details] Part 1 (Mesa 17.3) - Build anv and radv Changes since previous version: - Prepare for bug 214864
(In reply to Niclas Zeising from comment #18) > It would be extremely helpful if you could consolidate the patches > and mark any obsoleted patches as such. Not possible. Mesa 17.1, 17.2, 17.3 each require slightly different patches. I've renamed them to reduce confusion. Also, to avoid bisecting pain this should land separately from any unrelated changes. Before bug 223195 lands: 1. Apply "Part 1 (Mesa 17.2) - Build anv and radv" 2. Apply "Part 2 - Add WAYLAND option" 3. Commit After bug 223195 lands: 1. Apply "Part 1 (Mesa 17.3) - Build anv and radv" 2. Apply "Part 2 - Add WAYLAND option" 3. Commit
Thank you! This is helpful too, and made it clearer for me. One question, out of curiosity, the patches named "anv hacks for", what are those for? You've tagged them with don't land, but I'm curious anyway.
(In reply to Niclas Zeising from comment #23) > out of curiosity, the patches named "anv hacks for", what are those for? Workarounds for DRM_IOCTL_I915_GEM_USERPTR [1]. Requires root and too unstable but enough to do basic QA for anv. vulkaninfo works, vkquake crashes on vkWaitForFences (needs more hacks). [1] https://github.com/FreeBSDDesktop/freebsd-base-graphics/issues/132
Approved
Comment on attachment 188666 [details] Part 1 (Mesa 17.2) - Build anv and radv Mesa 17.3 has just landed. Mark this as osolete, since it's for mesa 17.2
I just landed mesa 17.3 in the ports tree. I'll let that simmer for a little while, and then I'll get to this as well.
A commit references this bug: Author: jbeich Date: Wed Dec 27 22:53:47 UTC 2017 New revision: 457430 URL: https://svnweb.freebsd.org/changeset/ports/457430 Log: graphics/mesa-dri: enable Vulkan drivers PR: 221540 Tested by: Greg V Approved by: x11 (zeising) Changes: head/graphics/mesa-dri/Makefile head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__gem.c head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__queue.c head/graphics/mesa-dri/pkg-plist
Landed it myself. We need to simmer Vulkan drivers on /head before 2018Q1 branches as well.
Having this bug fixed in 2018Q1 would simplify MFH of any future patch-level update that may require minor changes to Vulkan patches.
Oops, forgot about WAYLAND.
Comment on attachment 187404 [details] Part 2 - Add WAYLAND option Hmm, if graphics/mesa-libs is built with WAYLAND=off the following happens: checking for wayland-client >= 1.11... no configure: error: Package requirements (wayland-client >= 1.11) were not met: Package 'wayland-client', required by 'virtual:world', not found
Comment on attachment 187404 [details] Part 2 - Add WAYLAND option Looking into this.
Created attachment 189177 [details] Part 2 - Add WAYLAND option Let's add missing deps and IGNORE, assuming other drivers don't use Wayland. 10.3 i386/amd64, 11.1 i386/amd64, 12.0 amd64 are green. 11.1 aarch64/armv6, 12.0 aarch64/armv6/armv7 hit IGNORE e.g., =======================<phase: check-sanity >============================ ===> mesa-dri-17.3.1_1 option WAYLAND is only valid on platforms with Vulkan. *** Error code 1
A commit references this bug: Author: jbeich Date: Sat Dec 30 08:51:33 UTC 2017 New revision: 457591 URL: https://svnweb.freebsd.org/changeset/ports/457591 Log: graphics/mesa-dri: unbreak on powerpc* + clang after r457430 python2.7 ./radv_entrypoints_gen.py \ --xml ../../../src/vulkan/registry/vk.xml --outdir . Traceback (most recent call last): File "./radv_entrypoints_gen.py", line 30, in <module> from mako.template import Template ImportError: No module named mako.template PR: 221540 Reported by: Mark Millard (via ports@ list) Approved by: portmgr blanket Changes: head/graphics/mesa-dri/Makefile
Thanks for your submission! We are currently discussing how to handle vulkan drivers and the wayland option and we are working on this.
batch change of PRs untouched in 2018 marked "in progress" back to open.
A commit references this bug: Author: jbeich Date: Tue Oct 16 00:00:21 UTC 2018 New revision: 482192 URL: https://svnweb.freebsd.org/changeset/ports/482192 Log: graphics/mesa-dri: add WAYLAND option for Vulkan drivers PR: 221540 Submitted by: Greg V Approved by: maintainer timeout (9 months timeout), zeising (earlier version) Changes: head/graphics/mesa-dri/Makefile
A commit references this bug: Author: jbeich Date: Sat Oct 20 21:39:21 UTC 2018 New revision: 482625 URL: https://svnweb.freebsd.org/changeset/ports/482625 Log: graphics/mesa-dri: don't forbid WAYLAND on non-x86 At least aarch64, armv6, armv7 couldn't set OPTIONS_SET+=WAYLAND via make.conf (see also bug 227509) despite Wayland itself not having such a limitation. =>> Ignoring graphics/mesa-dri: option WAYLAND is only valid on platforms with Vulkan PR: 221540 Pointy hat to: jbeich (regressed by r482192) Changes: head/graphics/mesa-dri/Makefile