DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Failed to build the project with cmake, llvm-build: error: invalid target to enable: 'AMDGPU' (not in project)

Open hanyangl5 opened this issue 4 years ago • 8 comments

image

OS: Windows 11 GPU: AMD 6600xt Driver: AMD Software: Adrenalin Edition 22.51

to reproduce:

mkdir build
cd build
cmake ..

hanyangl5 avatar May 27 '22 14:05 hanyangl5

No, just "cmake .." doesn't work. You need to set parameters to it. Check cmake\caches\PredefinedParams.cmake for details.

gongminmin avatar May 27 '22 18:05 gongminmin

Thanks @gongminmin!

pow2clk avatar Jun 13 '22 20:06 pow2clk

Can someone please elaborate on what to do to fix this? In https://github.com/alaingalvan/CrossShader this project is added as CMake dependency in CMakeLists like this: add_subdirectory(external/directxshadercompiler) And I get the same compilation error when trying to compile to wasm. What can be done about this?

romamik avatar Dec 08 '22 16:12 romamik

I'd also really appreciate an elaboration on this, I'm stuck.

MolassesLover avatar Jan 09 '23 00:01 MolassesLover

Stumbled over this as well: in vulkan's DirectXShaderCompiler it helps to pass the path to the mentioned PredefinedParams.cmake like cmake -DDXC_USE_LIT=On -C ../cmake/caches/PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS="-v" ..

i copied this from source/DirectXShaderCompiler/CMakeSettings.json

SebTV avatar Apr 26 '23 09:04 SebTV

I don't really understand why/how DirectXShaderCompiler has this strange extra requirement or why the fix work,s but the above fix does also work for me - many thanks!

adamdmoss avatar May 28 '23 21:05 adamdmoss

I solved this problem directly in the CMakeLists .txt include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/caches/PredefinedParams.cmake).

keyi4541 avatar Jul 19 '23 03:07 keyi4541

I solved this problem directly in the CMakeLists .txt include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/caches/PredefinedParams.cmake).

2026 this problem still exists, Thansk to keyi4541 this problem could be solved this way!

yhyu13 avatar Feb 07 '26 08:02 yhyu13