Skip to content

D3D12: Remove unnecessary waits and command list executions#5

Merged
llvm-beanz merged 3 commits into
llvm:mainfrom
damyanp:cleanup
Dec 5, 2024
Merged

D3D12: Remove unnecessary waits and command list executions#5
llvm-beanz merged 3 commits into
llvm:mainfrom
damyanp:cleanup

Conversation

@damyanp

@damyanp damyanp commented Dec 5, 2024

Copy link
Copy Markdown
Contributor

There's no need to split the workload into multiple command-lists, and there are various unnecessary waitForSignal's that can be removed.

Also fixed logic for deciding if a resource is a UAV or not (UAV's are ReadWrite, not ReadOnly resources).

@llvm-beanz llvm-beanz merged commit 7a682c8 into llvm:main Dec 5, 2024
@damyanp damyanp deleted the cleanup branch December 5, 2024 23:53
Icohedron added a commit that referenced this pull request Apr 23, 2026
…e.so (#1107)

In Windows Subsystem for Linux, libd3d12.so is a shim that dlopen's
libd3d12core.so and uses dlsym to resolve D3D12GetInterface. Due to ELF
symbol interposition, dlsym may resolve back to libd3d12.so's own
export, causing infinite recursion and a stack overflow.

Example:
```
❯ ./api-query
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.      Program arguments: ./api-query
  #0 0x00005555556e960b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/icohedron/hlsl-dev/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
  #1 0x00005555556e70f5 llvm::sys::RunSignalHandlers() /home/icohedron/hlsl-dev/llvm-project/llvm/lib/Support/Signals.cpp:109:18
  #2 0x00005555556ea45a SignalHandler(int, siginfo_t*, void*) /home/icohedron/hlsl-dev/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
  #3 0x00007ffff7442790 __restore_rt (/nix/store/jms7zxzm7w1whczwny5m3gkgdjghmi2r-glibc-2.42-51/lib/libc.so.6+0x42790)
  #4 0x00007ffff7df4a21 (/usr/lib/wsl/lib/libd3d12.so+0xb7a21)
  #5 0x00007ffff7df6b6a (/usr/lib/wsl/lib/libd3d12.so+0xb9b6a)
  #6 0x00007ffff7df8ac6 D3D12GetInterface (/usr/lib/wsl/lib/libd3d12.so+0xbbac6)
  #7 0x00007ffff7df8adf D3D12GetInterface (/usr/lib/wsl/lib/libd3d12.so+0xbbadf)
...
#254 0x00007ffff7df8adf D3D12GetInterface (/usr/lib/wsl/lib/libd3d12.so+0xbbadf)
#255 0x00007ffff7df8adf D3D12GetInterface (/usr/lib/wsl/lib/libd3d12.so+0xbbadf)
Failed to query D3D info queue
Segmentation fault         (core dumped) ./api-query
```

This PR fixes the issue by explicitly linking libd3d12core.so before
libd3d12.so so it appears first in the global symbol table.

Assisted-by: Claude Opus 4.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants