sysgpu: Crash on run on Windows #1128

Open
opened 2023-12-25 18:29:54 +00:00 by foxnne · 1 comment
foxnne commented 2023-12-25 18:29:54 +00:00 (Migrated from github.com)

When using sysgpu, there is an immediate crash when running on Windows.

 *  Executing task: zig build run -Duse_dusk=true 

steps [27/30] zig build-exe pixi Debug native... LLD Link... thread 6068 panic: api error
C:\Users\foxnn\AppData\Local\zig\p\1220d0bf732d8291b8629ce7e115efb6adef84dcc1218317ee0a89a6f1663153f2a9\src\d3d12.zig:89:13: 0x7ff6fb24eae0 in init (pixi.exe.obj)
            return error.CreateDXGIFactoryFailed;
            ^
C:\Users\foxnn\AppData\Local\zig\p\122096b39d9266d275b780df4d63b1afe6e9a3726f19766baf74b34af3f092532cd3\src\platform\native\Core.zig:202:40: 0x7ff6fb255a8d in init (pixi.exe.obj)
    const instance = gpu.createInstance(null) orelse {
                                       ^
C:\Users\foxnn\AppData\Local\zig\p\122096b39d9266d275b780df4d63b1afe6e9a3726f19766baf74b34af3f092532cd3\src\main.zig:155:27: 0x7ff6fb2598b0 in init (pixi.exe.obj)
    try platform.Core.init(
                          ^
C:\Users\foxnn\dev\proj\pixi\src\pixi.zig:134:18: 0x7ff6fb25f87e in init (pixi.exe.obj)
    try core.init(.{
                 ^
C:\Users\foxnn\AppData\Local\zig\p\122096b39d9266d275b780df4d63b1afe6e9a3726f19766baf74b34af3f092532cd3\src\platform\native\main.zig:36:17: 0x7ff6fb265e0d in main (pixi.exe.obj)
    try app.init();
                ^
C:\Users\foxnn\.zvm\master\lib\std\start.zig:482:101: 0x7ff6fb266a79 in main (pixi.exe.obj)
    return @call(.always_inline, callMainWithArgs, .{ @as(usize, @intCast(c_argc)), @as([*][*:0]u8, @ptrCast(c_argv)), envp });
                                                                                                    ^
C:\Users\foxnn\.zvm\master\lib\libc\mingw\crt\crtexe.c:321:0: 0x7ff6fb62b385 in __tmainCRTStartup (crt2.obj)
    mainret = main (argc, argv, envp);

C:\Users\foxnn\.zvm\master\lib\libc\mingw\crt\crtexe.c:202:0: 0x7ff6fb62b3eb in mainCRTStartup (crt2.obj)
  ret = __tmainCRTStartup ();

???:?:?: 0x7ffda0c0257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffda2caaa57 in ??? (ntdll.dll)
run pixi: error: the following command exited with error code 3:
C:\Users\foxnn\dev\proj\pixi\zig-out\bin\pixi.exe
Build Summary: 28/30 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run pixi failure
error: the following build command failed with exit code 1:
C:\Users\foxnn\dev\proj\pixi\zig-cache\o\9e8e9cccf15f785a7b0947fb0db13867\build.exe C:\Users\foxnn\.zvm\master\zig.exe C:\Users\foxnn\dev\proj\pixi C:\Users\foxnn\dev\proj\pixi\zig-cache C:\Users\foxnn\AppData\Local\zig run -Duse_dusk=true

I spoke with @pdoane and the workaround is to change these lines to false and it will run successfully.

I believe this issue is already known, but I just wanted to stick an issue up for tracking :) Thanks!

When using sysgpu, there is an immediate crash when running on Windows. ``` * Executing task: zig build run -Duse_dusk=true steps [27/30] zig build-exe pixi Debug native... LLD Link... thread 6068 panic: api error C:\Users\foxnn\AppData\Local\zig\p\1220d0bf732d8291b8629ce7e115efb6adef84dcc1218317ee0a89a6f1663153f2a9\src\d3d12.zig:89:13: 0x7ff6fb24eae0 in init (pixi.exe.obj) return error.CreateDXGIFactoryFailed; ^ C:\Users\foxnn\AppData\Local\zig\p\122096b39d9266d275b780df4d63b1afe6e9a3726f19766baf74b34af3f092532cd3\src\platform\native\Core.zig:202:40: 0x7ff6fb255a8d in init (pixi.exe.obj) const instance = gpu.createInstance(null) orelse { ^ C:\Users\foxnn\AppData\Local\zig\p\122096b39d9266d275b780df4d63b1afe6e9a3726f19766baf74b34af3f092532cd3\src\main.zig:155:27: 0x7ff6fb2598b0 in init (pixi.exe.obj) try platform.Core.init( ^ C:\Users\foxnn\dev\proj\pixi\src\pixi.zig:134:18: 0x7ff6fb25f87e in init (pixi.exe.obj) try core.init(.{ ^ C:\Users\foxnn\AppData\Local\zig\p\122096b39d9266d275b780df4d63b1afe6e9a3726f19766baf74b34af3f092532cd3\src\platform\native\main.zig:36:17: 0x7ff6fb265e0d in main (pixi.exe.obj) try app.init(); ^ C:\Users\foxnn\.zvm\master\lib\std\start.zig:482:101: 0x7ff6fb266a79 in main (pixi.exe.obj) return @call(.always_inline, callMainWithArgs, .{ @as(usize, @intCast(c_argc)), @as([*][*:0]u8, @ptrCast(c_argv)), envp }); ^ C:\Users\foxnn\.zvm\master\lib\libc\mingw\crt\crtexe.c:321:0: 0x7ff6fb62b385 in __tmainCRTStartup (crt2.obj) mainret = main (argc, argv, envp); C:\Users\foxnn\.zvm\master\lib\libc\mingw\crt\crtexe.c:202:0: 0x7ff6fb62b3eb in mainCRTStartup (crt2.obj) ret = __tmainCRTStartup (); ???:?:?: 0x7ffda0c0257c in ??? (KERNEL32.DLL) ???:?:?: 0x7ffda2caaa57 in ??? (ntdll.dll) run pixi: error: the following command exited with error code 3: C:\Users\foxnn\dev\proj\pixi\zig-out\bin\pixi.exe Build Summary: 28/30 steps succeeded; 1 failed (disable with --summary none) run transitive failure └─ run pixi failure error: the following build command failed with exit code 1: C:\Users\foxnn\dev\proj\pixi\zig-cache\o\9e8e9cccf15f785a7b0947fb0db13867\build.exe C:\Users\foxnn\.zvm\master\zig.exe C:\Users\foxnn\dev\proj\pixi C:\Users\foxnn\dev\proj\pixi\zig-cache C:\Users\foxnn\AppData\Local\zig run -Duse_dusk=true ``` I spoke with @pdoane and the workaround is to change [these lines](https://github.com/hexops/mach-sysgpu/blob/e5682c4d05ab8f50defdf821be431eb7ead75111/src/d3d12.zig#L31-L34) to `false` and it will run successfully. I believe this issue is already known, but I just wanted to stick an issue up for tracking :) Thanks!
hordurj commented 2024-06-20 21:32:49 +00:00 (Migrated from github.com)

The DirectX Graphics Tools support feature needs to be enabled on Windows for this to work.
https://learn.microsoft.com/en-us/windows/win32/direct3d12/directx-12-programming-environment-set-up

So I think this should be changed to not panic if enabling debug layer fails. Maybe issue a warning in debug mode.

It is also possible to have the debug layers enabled in release mode.

The DirectX Graphics Tools support feature needs to be enabled on Windows for this to work. https://learn.microsoft.com/en-us/windows/win32/direct3d12/directx-12-programming-environment-set-up So I think this should be changed to not panic if enabling debug layer fails. Maybe issue a warning in debug mode. It is also possible to have the debug layers enabled in release mode.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach#1128
No description provided.