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

D3D12 libraries not installed to bin folder when building only slang-test #5462

Open
cheneym2 opened this issue Oct 30, 2024 · 2 comments
Open
Labels
Backlog goal:quality & productivity Quality issues and issues that impact our productivity coding day to day inside slang kind:bug something doesn't work like it should

Comments

@cheneym2
Copy link
Collaborator

This issue was discovered in the VS2022 workflow.

  1. IMPORTANT: Clean out any existing build/Release/bin and build/Debug/bin contents, as you won't notice the issue if there are files there from a previous build attempt.

  2. Initialize the VS solution file:

cmake --preset vs2022

  1. Open build/slang.sln file in visual studio

  2. Build by clicking the "Local Windows Debugger" icon (IMPORTANT, Do Not Use Build Solution)

The former method will only build the current project and its dependencies. It will not install D3D12 binaries and slang-tests using D3D12 will not work.

Observe:
NVIDIA.COM+acheney@acheney-lt3 /cygdrive/c/Users/acheney/Documents/git/slang5

$ ls C:/Users/acheney/Documents/git/slang5/build/Release/bin
dawn.dll                gfx.dll    platform.dll          slang-core-module.bin  slang-reflection-test-tool.dll  slang-test.exe  slang-unit-test-tool.dll  slang.slang  test-process.exe  webgpu_dawn.dll
gfx-unit-test-tool.dll  gfx.slang  render-test-tool.dll  slang-glslang.dll      slang-rt.dll                    slang-tint.dll  slang.dll                 slangd.exe   test-server.exe

D3D12 libraries are installed by a vcproj named "copy-prebuilt-binaries" and that is a dependency of the whole solution, so using the "Build Solution" command does not see this issue.

Observe the contents of the build folder AFTER using the Build Solution command. It has the D3D12 folder (and many other files). slang-test d3d12 tests will work after doing that.

NVIDIA.COM+acheney@acheney-lt3 /cygdrive/c/Users/acheney/Documents/git/slang5
$ ls C:/Users/acheney/Documents/git/slang5/build/Release/bin
D3D12                 d3dcompiler_47.dll  gfx-unit-test-tool.dll  hello-world.exe    ray-tracing-pipeline.exe  shader-toy.exe         slang-reflection-test-tool.dll  slang-tint.dll            slangc.exe        triangle.exe
autodiff-texture.exe  dawn.dll            gfx.dll                 model-viewer.exe   ray-tracing.exe           slang-core-module.bin  slang-replay.exe                slang-unit-test-tool.dll  slangd.exe        webgpu_dawn.dll
cpu-com-example.exe   dxcompiler.dll      gfx.slang               platform-test.exe  render-test-tool.dll      slang-glslang.dll      slang-rt.dll                    slang.dll                 test-process.exe
cpu-hello-world.exe   dxil.dll            gpu-printing.exe        platform.dll       shader-object.exe         slang-profile.exe      slang-test.exe                  slang.slang               test-server.exe

There should be a dependency placed between slang-test and any other apps we run in the slang solution that depend on D3D12 libraries.

Inserting this at the end of CMakeLists.txt works, but it seems like a hack.

    if(SLANG_ENABLE_PREBUILT_BINARIES)
      add_dependencies(slang-test, copy-prebuilt-binaries)
    endif()
@cheneym2 cheneym2 added this to the Q4 2024 (Fall) milestone Oct 30, 2024
@cheneym2 cheneym2 added the kind:bug something doesn't work like it should label Oct 30, 2024
@expipiplus1
Copy link
Collaborator

that's pretty much the correct solution, but it might be slightly nicer to do with adding a REQUIRED_BY argument to the copy-prebuilt-binaries target, or adding a REQUIRES to slang-test (and friends). whatever's neater. cmake generator expressions can be used to make the conditional tidy and not

@bmillsNV bmillsNV added the goal:quality & productivity Quality issues and issues that impact our productivity coding day to day inside slang label Oct 31, 2024
@bmillsNV bmillsNV removed this from the Q1 2025 (Winter) milestone Feb 6, 2025
@bmillsNV
Copy link
Collaborator

bmillsNV commented Feb 6, 2025

We're unable to prioritize this right now, placing on backlog. We would greatly welcome contribution if someone wants to take this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog goal:quality & productivity Quality issues and issues that impact our productivity coding day to day inside slang kind:bug something doesn't work like it should
Projects
None yet
Development

No branches or pull requests

3 participants