-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Windows ROCm Build. #2843
Comments
You can set them as environment variables before running cmake, or you can pass them as arguments. cmake -B build -G "Ninja" -DCMAKE_C_COMPILER=clang.exe -DCMAKE_CXX_COMPILER=clang++.exe -DLLAMA_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release If the HIP bin folder isn't in your |
Sorry but can you perhaps translate that guide into plain english? I'm quite new with cmake and building stuff from source, meaning I have no idea what to do. I did try
|
After trying it, even if you build llama.cpp on Windows without the HIP SDK bin folder in your path (C:\Program Files\AMD\ROCm\5.5\bin) the resulting executables won't run because they can't find the .dll files there. The first thing to do is to add that folder to your set CC=clang.exe
set CXX=clang++.exe
cd your-llamacpp-folder
mkdir build
cd build
cmake .. -G "Ninja" -DLLAMA_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS=YourGPUTarget
cmake --build . You need to pass |
The CMake file should be updated for Windows support. I noticed that the SDK configures an environment variable |
not sure if this is the right ticket, but i think it would be desirable for a build that can support both nvidia and rocm, if the libs are present, would be quite useful. maybe that's just opencl? |
The architecture doesn't support that. Some applications that use llama.cpp as a dynamic library can do it by having different versions of llama.dll to load. |
I managed to get past the the binaries location but now I get the following error: -- The C compiler identification is Clang 17.0.0 with GNU-like command-line
is not able to compile a simple test program. It fails with the following output:
CMake will not be able to correctly generate this project. |
I was able to compile and run everything on my 7900XTX desktop but failed with my 6700XT system. |
Interesting, I have the 7900XTX also now but it should not matter, though. Was it on Windows 10 or 11? |
I think i know the reason now, you need to add rocm/bin to the env as path, then it should work. |
I tried to build it on Windows 11 with an rx 5700 and I get this error, I followed the steps listed here:
EDIT: EDIT 2:
EDIT 3: |
@davtur19 How did you fix it by installing perl? What does perl have to do with The C compiler ... is not able to compile a simple test program? |
@zbrkic rocm to build requires perl apparently, or at least for the version I was trying to build https://github.com/search?q=repo%3AROCm%2FROCm+perl&type=code |
Hello, could you share which version of release do you use for hip blas? |
@fyq163 I used the rocm-5.7.1 branch |
Building with ROCm always comes with headaches, it would seem in my case! I've also tried this on Linux back then, same number of headaches. Rant aside, has anyone encountered this error? I'm on Windows 11, RX 6800 XT, using x64 Native Tools (VS 2022) with the latest HIP SDK installed. I've also installed Strawberry Perl (thanks to @davtur19) but it has not fixed the issue. rocm/bin is in PATH. hipconfig.pl does exist, I've checked!
|
may caused by the below error. |
That is pretty weird! I wonder what's causing the issue. gfx1030 should be supported, if that's the platform it's complaining about. Hmm... |
I meet same error as you are facing. it can be solved via install https://strawberryperl.com/ |
I already Strawberry Perl and it sadly didn't fix the issue. But, I managed to get it working by fiddling with the code, specifically hipconfig from my $isWindows = ($^O eq 'MSWin32' or $^O eq 'msys');
my $SCRIPT_DIR= 'C:\Program Files\AMD\ROCm\5.7\bin';
if ($USE_PERL_SCRIPT) {
#Invoke hipconfig.pl
my $HIPCONFIG_PERL=catfile($SCRIPT_DIR, 'hipconfig.pl');
system($^X, $HIPCONFIG_PERL, @ARGV);
} else {
$BIN_NAME="hipconfig.bin";
if ($isWindows) {
$BIN_NAME="hipconfig.bin.exe";
}
my $HIPCONFIG_BIN=catfile($SCRIPT_DIR, $BIN_NAME);
if ( -e $HIPCONFIG_BIN ) {
#Invoke hipconfig.bin
system($HIPCONFIG_BIN, @ARGV);
} else {
print "hipconfig.bin not present; Install HIPCC binaries before proceeding";
exit(-1);
}
} It compiled successfully after that. No problems running llama-bench.exe too. llama-bench.exe -m Blue-Orchid-2x7b-Q4_K_M.gguf -p 3968 -n 128 -ngl 99
ggml_init_cublas: GGML_CUDA_FORCE_MMQ: no
ggml_init_cublas: CUDA_USE_TENSOR_CORES: yes
ggml_init_cublas: found 1 ROCm devices:
Device 0: AMD Radeon RX 6800 XT, compute capability 10.3, VMM: no
| model | size | params | backend | ngl | test |
t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ---------- | ---------------: |
| llama 7B Q4_K - Medium | 7.25 GiB | 12.88 B | ROCm | 99 | tg 128 | 18.19 ± 0.40 |
build: 7ce2c77f (2434) |
I have the same issue with clang failing to compile a test program.
I dug a little deeper, but I don't see anything obviously wrong.
|
The problem was that I was running the Developer Command Prompt instead of the x64 Developer Command Prompt. |
this is my full script to compile it under windows.. adapt it to your needs: |
I'm getting this same issue using the x64 prompt |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Hello! I'm trying to compile llama.cpp for ROCm on windows, the problem I'm having is that CMake uses CC=/opt/rocm/llvm/bin/clang and CXX=/opt/rocm/llvm/bin/clang++ but on windows the locations are at "C:\Program Files\AMD\ROCm\5.5\bin\clang.exe" and "C:\Program Files\AMD\ROCm\5.5\bin\clang++.exe", is there any way for me to compile it with those locations? I tried on visual studio with cmake but it says "CC not recognized as internal or external command".
The text was updated successfully, but these errors were encountered: