Yes, that is my understanding. And I was able to give it a test on a different computer with an Nvidia card and can confirm that that if fails at the DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE call.
I’d like to drill into this once I have things more stable on the AMD side. There must be some way to coerce the Nvidia driver into spitting out a syncobj.
A data point from Asahi Linux (M1) - Linux mbpp 6.19.14-400.asahi.fc42.aarch64+16k
I switched the target to -Dtarget=aarch64-linux-gnu and it built first time but running gave:
error(vk_general): loader_validate_layers: Layer 0 does not exist in the list of available layers
Looking at the code, it seems to use/request a validation layer, so I switched to --release=fast and then I got:
info(vulkan): Physical device name: "Apple M1 Pro (G13S C0)", type: integrated_gpu, API version: 1.4.328, driver version: 104869894 error: NoValidMemoryType
So I hacked the code a bit to match what I was seeing from my vulkaninfo output, and I ended up with this:
fn _initMemoryTypeIndices() !void {
const properties = vki.getPhysicalDeviceMemoryProperties(physicalDevice);
for (0..properties.memory_heap_count) |i| {
const heapType = properties.memory_heaps[i];
if (heapType.flags.device_local_bit) {
deviceMemoryTypeIndex = @intCast(i);
break;
}
} else {
return error.NoValidMemoryType;
}
for (0..properties.memory_type_count) |i| {
const memoryType = properties.memory_types[i];
if (memoryType.property_flags.host_visible_bit and
memoryType.property_flags.host_coherent_bit and
!memoryType.property_flags.host_cached_bit and
memoryType.property_flags.device_local_bit) {
hostMemoryTypeIndex = @intCast(i);
break;
}
} else {
return error.NoValidMemoryType;
}
}
And the great news is that it now works!!! 60fps butterly smooth resize, drag, and can get to fullscreen and back. Nice work all!! But oh poo! what have you done, I thought I’d given up on games development
I’m getting a panic when I try this (Version 29064d0c):
➜ presentation-example git:(main) ✗ zig-out/bin/test
WARNING: radv is not a conformant Vulkan implementation, testing use only.
info(vulkan): Physical device name: "AMD Radeon RX 9060 XT (RADV GFX1200)", type: discrete_gpu, API version: 1.4.348, driver version: 109056003
thread 869897 panic:
/home/pauls/Research/zig/presentation-example/window/window.zig:152:21: 0x121c417 in init (window.zig)
@panic("");
^
/home/pauls/Research/zig/presentation-example/test/test.zig:15:16: 0x11f0e0d in main (test.zig)
window.init(.{
^
/home/pauls/.cache/zig/p/N-V-__8AAFFSVRWqblwBIcA-Yqv-u7sbjsJoww8K0mWaHbmJ/lib/std/start.zig:699:88: 0x11f17a8 in callMain (std.zig)
if (fn_info.params[0].type.? == std.process.Init.Minimal) return wrapMain(root.main(.{
^
???:?:?: 0x7f678da27740 in ??? (/usr/lib/libc.so.6)
???:?:?: 0x7f678da27878 in ??? (/usr/lib/libc.so.6)
/home/pauls/.cache/zig/p/N-V-__8AAFFSVRWqblwBIcA-Yqv-u7sbjsJoww8K0mWaHbmJ/lib/libc/glibc/sysdeps/x86_64/start-2.33.S:120: 0x12657e9 in ??? (/home/pauls/.cache/zig/p/N-V-__8AAFFSVRWqblwBIcA-Yqv-u7sbjsJoww8K0mWaHbmJ/lib/libc/glibc/sysdeps/x86_64/start-2.33.S)
call *__libc_start_main@GOTPCREL(%rip)
[2] 869897 abort (core dumped) zig-out/bin/test
window.zig
----------
// Check that all globals are found
for (std.enums.values(_WlGlobal)) |global| {
if (_wlGlobalNames.get(global) == 0) {
// Allow XDG Decoration Manager to be optional (thanks Gnome)
if (global == .zxdg_decoration_manager_v1) {
_haveXdgDecoration = false;
} else {
@panic(""); // PANIC HERE
}
}
}
}
Adding a debug print just before the panic tells me that the value of global of wp_linux_drm_syncobj_manager_v1.
I think it’s in poor taste when a project comes with a shell.nix checked into the source repository.
Zig has no dependency on Nix, nor does it favor NixOS above other distributions, nor does it even favor Linux above other operating systems.
We also don’t list apt-get commands that you would use on Debian to install LLVM, and we don’t have screenshots of how to set up LLVM on Windows. We don’t have vim editor configuration or vscode editor configuration files in the repo. That documentation belongs outside ziglang/zig source repository.
We also don’t put .DS_Store, *.swp or other editor-specific files in .gitignore. That belongs in the user’s global .gitignore. We also don’t ever assume the user will use git, for example in zig init we do not initialize a .gitignore file.
Hopefully this helps paint the picture. There are an infinite number of third party projects that zig can live with or interact with, from the past, present, and future, and picking favorites is completely outside the scope of the project.
thank you Andrew for taking the time to respond to us users, we might be a bother sometimes (you could just say “we would then need to provide builds for other systems” and be done, but rather you took time to explain and I wanted to thank you for that)
anyways, ok, we shall keep that in mind anytime we want to “favor” any distro or build system. no favoring
It looks like that means you don’t have validation layers available. You could install those, or you could remove the code that asks for them, which is nearby your stack trace.
I got the same error on Arch/Hyprland (NVIDIA discrete, AMD integrated GPU). I assumed it was just something misconfigured in my environment (maybe still is?). I installed vulkan-validation-layers package, but now I get the panic that @WeeBull posted about.
When I explicitly tell it to use the AMD drivers, it does work on the integrated card, so progress?