TheRock: [Windows] hipcc is looking for tools, headers, and libraries in the wrong places
On Linux, one can use hipcc from TheRock’s build directory like hipcc hello.cpp -o hello as expected. On Windows, hipcc fails looking for clang++ and lld:
D:\therock-output-gfx1036\build\dist\rocm\bin\hipcc.exe -Og .\hello.cpp -c -o .\hello.o
'D:\therock-output-gfx1036\build\dist\rocm\bin\clang++' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
'nvcc' is not recognized as an internal or external command,
operable program or batch file.
Device not supported - Defaulting to AMD
To successfully build hip test program, I have to:
- Make a symlink to
clang++and place it next tohipcc.exeindist\rocm\bin(Tools) - Explicitly pass
-Itodist\rocm\include, which should be in the default header search path (Headers) - Explicitly pass
-Lto the directory containingamdhip64.lib, which is not placed underdist\rocm\lib(Libraries)- All
.libfiles should probably be installed indist\rocm\lib
- All
\therock-output\build\dist\rocm\bin\hipcc -c -Og --driver-mode=g++ -D__HIP_PLATFORM_AMD__ --offload-arch=$AMD_GPU_FAMILY -I D:\therock-output-gfx1036\build\dist\rocm\include .\hello.cpp -o hello.o
\therock-output\build\dist\rocm\lib\llvm\bin\clang.exe -Og --driver-mode=g++ --offload-arch=$AMD_GPU_FAMILY -D__HIP_PLATFORM_AMD__ -L D:\therock-output\build\core\clr\dist\lib .\hello.o -lamdhip64 -o hello.exe
hipcc -v logs from Windows and Linux attached.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (12 by maintainers)
I was able to workaround this by setting
HIP_CLANG_PATHto<therock_build_dir>/dist/rocm/lib/llvm/bin. It’s likely that thehipcc.plscript is incorrectly setting the defaultHIP_CLANG_PATHThis is still using the legacy locations for the compiler tools vs in lib/llvm/bin. On Linux, we install some backward compat symlinks. We should just send a patch that updates it to the right paths across the board.
#422 fixes the bug that was keeping .lib files from installing.
We’re going to have the same directory layout between Linux/Windows. The old layout and windows paths just haven’t been updated.
The choices that hipsdk made were not synchronized with where anything else was going, so we’ll just fix forward to the right layout.
Yeah I’m not sure either. If the AMD provided HIP SDK installs into
rocm/bininstead ofrocm/lib/llvm/bin, that would explain thisisWindowsthing.Regardless, we could either have your diff as a patch applied while building TheRock, or have TheRock itself building llvm binaries into the new path. I’m leaning towards having them unified, but differing from what AMD has done might break things down the road, so not sure… though at the moment, nothing seems broken yet as long as you have the correct HIP_CLANG_PATH set.