Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: sprite and hardware-check examples fail with error.CommandListCloseFailed #1336

Open
marler8997 opened this issue Jan 19, 2025 · 3 comments
Labels
bug Something isn't working os/windows

Comments

@marler8997
Copy link
Contributor

C:\git\mach>zig-mach build run-sprite
zig-mach build run-sprite

C:\git\mach>zigup run 0.14.0-dev.2577+271452d22 build run-sprite 
debug(mach): primary monitor work topleft=0,0 size=2560x1390
info(mach): found D3D12 backend on Discrete GPU adapter: AMD Radeon RX 6900 XT, 

C:\git\mach\Shader@0x00000235BCAE2CC8(14,22): warning X3578: Output value 'vertMain' is not completely initialized

thread 37736 panic: api error
C:\git\mach\src\sysgpu\d3d12.zig:3237:13: 0x7ff7d35b45b8 in finish (sprite.exe.obj)
            return error.CommandListCloseFailed;
            ^
C:\git\mach\src\sysgpu\d3d12.zig:4070:36: 0x7ff7d35b4b90 in submit (sprite.exe.obj)
            const command_buffer = try command_encoder.finish(&.{});
                                   ^
C:\git\mach\src\gfx\Sprite.zig:435:28: 0x7ff7d359f51c in updatePipelineBuffers (sprite.exe.obj)
        window.queue.submit(&[_]*gpu.CommandBuffer{command});
                           ^
C:\git\mach\src\gfx\Sprite.zig:198:55: 0x7ff7d359933c in tick (sprite.exe.obj)
        if (any_sprites_updated) updatePipelineBuffers(sprite, core, pipeline_id, pipeline_children.items);
                                                      ^
C:\git\mach\src\module.zig:668:29: 0x7ff7d357d9a6 in run__anon_34416 (sprite.exe.obj)
                    switch (@typeInfo(Ret)) {
                            ^
C:\git\mach\src\module.zig:691:57: 0x7ff7d355e331 in callDynamic (sprite.exe.obj)
                        inline else => |fn_name| mod.run(fn_name),
                                                        ^
C:\git\mach\src\module.zig:654:61: 0x7ff7d35316db in run (sprite.exe.obj)
                                        modules2.callDynamic(fn_id);
                                                            ^
C:\git\mach\src\module.zig:448:19: 0x7ff7d3623bcf in run (sprite.exe.obj)
            r._run(r._ctx, fn_id);
                  ^
C:\git\mach\src\module.zig:453:18: 0x7ff7d35bee62 in call__anon_42161 (sprite.exe.obj)
            r.run(fn_id);
                 ^
C:\git\mach\examples\sprite\App.zig:204:20: 0x7ff7d35be166 in tick (sprite.exe.obj)
    sprite_mod.call(.tick);
                   ^
C:\git\mach\src\module.zig:668:29: 0x7ff7d357dc76 in run__anon_34419 (sprite.exe.obj)
                    switch (@typeInfo(Ret)) {
                            ^
C:\git\mach\src\module.zig:691:57: 0x7ff7d355e502 in callDynamic (sprite.exe.obj)
                        inline else => |fn_name| mod.run(fn_name),
                                                        ^
C:\git\mach\src\module.zig:654:61: 0x7ff7d35316db in run (sprite.exe.obj)
                                        modules2.callDynamic(fn_id);
                                                            ^
C:\git\mach\src\module.zig:448:19: 0x7ff7d353f41f in run (sprite.exe.obj)
            r._run(r._ctx, fn_id);
                  ^
C:\git\mach\src\Core.zig:259:17: 0x7ff7d353f388 in main (sprite.exe.obj)
    core_mod.run(core.on_tick.?);
                ^
C:\git\mach\src\module.zig:668:29: 0x7ff7d3507fe6 in run__anon_7549 (sprite.exe.obj)
                    switch (@typeInfo(Ret)) {
                            ^
C:\git\mach\src\module.zig:629:40: 0x7ff7d3502063 in run__anon_5895 (sprite.exe.obj)
                            callMod.run(callFn);
                                       ^
C:\git\mach\examples\sprite\main.zig:22:12: 0x7ff7d3501120 in main (sprite.exe.obj)
    app.run(.main);
           ^
D:\bin\zig\0.14.0-dev.2577+271452d22\files\lib\std\start.zig:631:75: 0x7ff7d35022da in main (sprite.exe.obj)
    return callMainWithArgs(@as(usize, @intCast(c_argc)), @as([*][*:0]u8, @ptrCast(c_argv)), envp);
                                                                          ^
D:\bin\zig\0.14.0-dev.2577+271452d22\files\lib\libc\mingw\crt\crtexe.c:259:0: 0x7ff7d39cdb73 in __tmainCRTStartup (crt2.obj)
    mainret = _tmain (argc, argv, envp);

D:\bin\zig\0.14.0-dev.2577+271452d22\files\lib\libc\mingw\crt\crtexe.c:180:0: 0x7ff7d39cdbdb in mainCRTStartup (crt2.obj)
  ret = __tmainCRTStartup ();

???:?:?: 0x7ffe41217373 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffe417dcc90 in ??? (ntdll.dll)
run-sprite
+- run sprite failure
error: the following command exited with error code 3:
C:\git\mach\zig-out\bin\sprite.exe 
Build Summary: 25/27 steps succeeded; 1 failed
run-sprite transitive failure
+- run sprite failure
error: the following build command failed with exit code 1:
C:\git\mach\.zig-cache\o\fe48717669c07105f0b0421280a4f7bd\build.exe D:\bin\zig\0.14.0-dev.2577+271452d22\files\zig.exe D:\bin\zig\0.14.0-dev.2577+271452d22\files\lib C:\git\mach C:\git\mach\.zig-cache C:\Users\Jonathan\AppData\Local\zig --seed 0xec49cd82 -Z62ca78721e46def3 run-sprite


@marler8997 marler8997 added bug Something isn't working needs-triage Issues that need triaging labels Jan 19, 2025
@emidoots emidoots changed the title <project>: <the problem> windows: sprite and hardware-check examples fail with error.CommandListCloseFailed Jan 19, 2025
@emidoots emidoots added os/windows and removed needs-triage Issues that need triaging labels Jan 19, 2025
@emidoots
Copy link
Member

Another repro of this from discord:

$ zig build run-hardware-check
debug: failed to determine terminal size; using conservative guess 80x25
info(mach_audio): opened audio device: channels=2 sample_rate=48000 format=f32
debug(mach): primary monitor work topleft=0,0 size=1920x1080
info(mach): found D3D12 backend on Integrated GPU adapter: Intel(R) UHD Graphics 620,

B:\c-workspace\mach\Shader@0x00000239C66917D8(14,22): warning X3578: Output value 'vertMain' is not completely initialized

thread 2388 panic: api error
B:\c-workspace\mach\src\sysgpu\d3d12.zig:3237:13: 0x7ff645a23988 in finish (hardware-check.exe.obj)
            return error.CommandListCloseFailed;
            ^
B:\c-workspace\mach\src\sysgpu\d3d12.zig:4070:36: 0x7ff645a23f60 in submit (hardware-check.exe.obj)
            const command_buffer = try command_encoder.finish(&.{});
                                   ^
B:\c-workspace\mach\src\gfx\Sprite.zig:435:28: 0x7ff6459d390c in updatePipelineBuffers (hardware-check.exe.obj)
        window.queue.submit(&[_]*gpu.CommandBuffer{command});
                           ^
B:\c-workspace\mach\src\gfx\Sprite.zig:198:55: 0x7ff6459cd72c in tick (hardware-check.exe.obj)
        if (any_sprites_updated) updatePipelineBuffers(sprite, core, pipeline_id, pipeline_children.items);
                                                      ^
B:\c-workspace\mach\src\module.zig:668:29: 0x7ff6459ae1f6 in run__anon_40825 (hardware-check.exe.obj)
                    switch (@typeInfo(Ret)) {
                            ^
B:\c-workspace\mach\src\module.zig:691:57: 0x7ff64598a3ad in callDynamic (hardware-check.exe.obj)
                        inline else => |fn_name| mod.run(fn_name),
                                                        ^
B:\c-workspace\mach\src\module.zig:654:61: 0x7ff64595cfab in run (hardware-check.exe.obj)
                                        modules2.callDynamic(fn_id);
                                                            ^
B:\c-workspace\mach\src\module.zig:448:19: 0x7ff645b3d95f in run (hardware-check.exe.obj)
            r._run(r._ctx, fn_id);
                  ^
B:\c-workspace\mach\src\module.zig:453:18: 0x7ff645a4a6b2 in call__anon_57001 (hardware-check.exe.obj)
            r.run(fn_id);
                 ^
B:\c-workspace\mach\examples\hardware-check\App.zig:320:20: 0x7ff645a47e6c in tick (hardware-check.exe.obj)
    sprite_mod.call(.tick);
                   ^
B:\c-workspace\mach\src\module.zig:668:29: 0x7ff6459aebac in run__anon_40836 (hardware-check.exe.obj)
                    switch (@typeInfo(Ret)) {
                            ^
B:\c-workspace\mach\src\module.zig:691:57: 0x7ff64598a75d in callDynamic (hardware-check.exe.obj)
                        inline else => |fn_name| mod.run(fn_name),
                                                        ^
B:\c-workspace\mach\src\module.zig:654:61: 0x7ff64595cfab in run (hardware-check.exe.obj)
                                        modules2.callDynamic(fn_id);
                                                            ^
B:\c-workspace\mach\src\module.zig:448:19: 0x7ff64596b48f in run (hardware-check.exe.obj)
            r._run(r._ctx, fn_id);
                  ^
B:\c-workspace\mach\src\Core.zig:259:17: 0x7ff64596b3f8 in main (hardware-check.exe.obj)
    core_mod.run(core.on_tick.?);
                ^
B:\c-workspace\mach\src\module.zig:668:29: 0x7ff6459291c6 in run__anon_11409 (hardware-check.exe.obj)
                    switch (@typeInfo(Ret)) {
                            ^
B:\c-workspace\mach\src\module.zig:629:40: 0x7ff645922e23 in run__anon_8685 (hardware-check.exe.obj)
                            callMod.run(callFn);
                                       ^
B:\c-workspace\mach\examples\hardware-check\main.zig:24:12: 0x7ff645921120 in main (hardware-check.exe.obj)
    app.run(.main);
           ^
C:\Users\missing\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zig\windows-x86_64-0.14.0-dev.2577+271452d22\lib\std\start.zig:631:75: 0x7ff64592309a in main (hardware-check.exe.obj)
    return callMainWithArgs(@as(usize, @intCast(c_argc)), @as([*][*:0]u8, @ptrCast(c_argv)), envp);
                                                                          ^
C:\Users\missing\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zig\windows-x86_64-0.14.0-dev.2577+271452d22\lib\libc\mingw\crt\crtexe.c:259:0: 0x7ff645e3a9c2 in __tmainCRTStartup (crt2.obj)
    mainret = _tmain (argc, argv, envp);

C:\Users\missing\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zig\windows-x86_64-0.14.0-dev.2577+271452d22\lib\libc\mingw\crt\crtexe.c:180:0: 0x7ff645e3aa2b in mainCRTStartup (crt2.obj)
  ret = __tmainCRTStartup ();

???:?:?: 0x7ffe9add7373 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffe9c15cc90 in ??? (ntdll.dll)
run-hardware-check
└─ run hardware-check failure
error: the following command exited with error code 3:
B:\c-workspace\mach\zig-out\bin\hardware-check.exe

@emidoots
Copy link
Member

Interestingly, I can't repro on my new windows dev machine (AMD gpu)

@marler8997
Copy link
Contributor Author

marler8997 commented Jan 23, 2025

Just a guess, I wonder if the difference between working/non working systems could be whether the d3d12 sdk is installed as this enables extra debugging options that can cause more checks to be verified. Does mach enable debug options when it creates the d3d12 device and/or does it have a fallback if it fails to enable debug options?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os/windows
Projects
None yet
Development

No branches or pull requests

2 participants