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

[Bug]: Cannot select while compiling llama.cpp on Windows #1999

Closed
ValleZ opened this issue Feb 11, 2024 · 4 comments
Closed

[Bug]: Cannot select while compiling llama.cpp on Windows #1999

ValleZ opened this issue Feb 11, 2024 · 4 comments
Labels

Comments

@ValleZ
Copy link

ValleZ commented Feb 11, 2024

Description

When I try to compile release version ndk fails:

fatal error: error in backend: Cannot select: 0x1a48200ab70: v4f32 = fmaxnum 0x1a48176ba10, 0x1a4fd8dc7a0, _deps/llama-src/ggml.c:1467:117 @[ _deps/llama-src/ggml.c:9149:9 @[ _deps/llama-src/ggml.c:9162:17 @[ _deps/llama-src/ggml.c:14249:17 ] ] ]
0x1a48176ba10: v4f32,i32,ch = ARMISD::VLD1_UPD<(load (s128) from %ir.485, align 4, !tbaa !2313)> 0x1a4fe235cf0, 0x1a48340bbe0, Constant:i32<16>, Constant:i32<1>, _deps/llama-src/ggml.c:1467:118 @[ _deps/llama-src/ggml.c:9149:9 @[ _deps/llama-src/ggml.c:9162:17 @[ _deps/llama-src/ggml.c:14249:17 ] ] ]
0x1a48340bbe0: i32,ch = CopyFromReg 0x1a4fe235cf0, Register:i32 %147, _deps/llama-src/ggml.c:1467:118 @[ _deps/llama-src/ggml.c:9149:9 @[ _deps/llama-src/ggml.c:9162:17 @[ _deps/llama-src/ggml.c:14249:17 ] ] ]
0x1a4833f9e30: i32 = Register %147
0x1a483408220: i32 = Constant<16>
0x1a48200bf90: i32 = Constant<1>
0x1a4fd8dc7a0: v4f32 = bitcast 0x1a482180ab0, _deps/llama-src/ggml.c:1467:123 @[ _deps/llama-src/ggml.c:9149:9 @[ _deps/llama-src/ggml.c:9162:17 @[ _deps/llama-src/ggml.c:14249:17 ] ] ]
0x1a482180ab0: v4i32 = ARMISD::VMOVIMM TargetConstant:i32<0>, _deps/llama-src/ggml.c:1467:123 @[ _deps/llama-src/ggml.c:9149:9 @[ _deps/llama-src/ggml.c:9162:17 @[ _deps/llama-src/ggml.c:14249:17 ] ] ]
0x1a483407810: i32 = TargetConstant<0>
In function: ggml_compute_forward_unary
PLEASE submit a bug report to https://github.com/android-ndk/ndk/issues and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:

  1. Program arguments: C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi31 --sysroot=C:/Users/valle/AppData/Local/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/windows-x86_64/sysroot -D_XOPEN_SOURCE=600 -IC:/Valle/dev/privateai/app/.cxx/Release/5u04g362/armeabi-v7a/_deps/llama-src/. -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -O3 -DNDEBUG -fPIC -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration -Wunreachable-code-break -Wunreachable-code-return -Wdouble-promotion -mfpu=neon-fp-armv8 -mno-unaligned-access -funsafe-math-optimizations -pthread -std=gnu11 -MD -MT _deps/llama-build/CMakeFiles/ggml.dir/ggml.c.o -MF _deps\llama-build\CMakeFiles\ggml.dir\ggml.c.o.d -o _deps/llama-build/CMakeFiles/ggml.dir/ggml.c.o -c C:/Valle/dev/privateai/app/.cxx/Release/5u04g362/armeabi-v7a/_deps/llama-src/ggml.c
  2. parser at end of file
  3. Code generation
  4. Running pass 'Function Pass Manager' on module 'C:/Valle/dev/privateai/app/.cxx/Release/5u04g362/armeabi-v7a/_deps/llama-src/ggml.c'.
  5. Running pass 'ARM Instruction Selection' on function '@ggml_compute_forward_unary'
    Exception Code: 0xE0000046
    #0 0x00007fff2f95567c (C:\WINDOWS\System32\KERNELBASE.dll+0x6567c)
    Clang3.8 cross-compile linker issues libc (undefined references) #1 0x00007ff6378ed34a (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x54d34a)
    ndk-gdb fails on OS X #2 0x00007ff63791f479 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x57f479)
    ndk-gdb.py fails #3 0x00007ff6373a8ed7 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x8ed7)
    ndk-gdb.py --project option treats ~/... as a relative path #4 0x00007ff6378eed7c (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x54ed7c)
    Unknown argument -mandroid #5 0x00007ff638e5d8ac (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1abd8ac)
    asan_device_setup error bricks phone #6 0x00007ff638e5c835 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1abc835)
    no renderscript headers/library in r11 #7 0x00007ff637e6d11b (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0xacd11b)
    clang __thread caused linker error #8 0x00007ff638e544cf (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1ab44cf)
    Clang not compiled with OpenMP support #9 0x00007ff638e53b1a (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1ab3b1a)
    error: undefined reference to '__atomic_exchange_4' #10 0x00007ff638e53430 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1ab3430)
    Support for _POSIX_THREAD_SAFE_FUNCTIONS #11 0x00007ff638e52e18 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1ab2e18)
    ld.bfd 2.25.51 packaged with NDK r11 produces unsupported R_ARM_COPY relocation #12 0x00007ff638e509bf (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1ab09bf)
    No support for debugging library projects #13 0x00007ff637e699e4 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0xac99e4)
    Using precompiled header causes compilation error of tagged files #14 0x00007ff637bbd0d1 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x81d0d1)
    Compile error when including <complex> #15 0x00007ff63763923b (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x29923b)
    Compile error when using clang and precompiled headers #16 0x00007ff637640b03 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x2a0b03)
    r11: libc++_static.a contains symbols in libc.a (causes multiple definition error) #17 0x00007ff637639f74 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x299f74)
    Extraction instructions are wrong #18 0x00007ff6387d6aaf (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1436aaf)
    r11: some commands removed from NDK_ROOT #19 0x00007ff638ba2598 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1802598)
    ndk-stack does not work with 64-bit binaries #20 0x00007ff63a3dce1b (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x303ce1b)
    Clang produces much larger binaries than GCC #21 0x00007ff638b05264 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1765264)
    NDK r11 for Linux size / hash mismatch #22 0x00007ff637a9a7a4 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x6fa7a4)
    NDK r11 undefined reference #23 0x00007ff637b1fccf (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x77fccf)
    ndk-stack file is missing #24 0x00007ff6373a8941 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x8941)
    NDK 2.0.0 fails to installs as part of Android Studio 1.5.1 (Download finished with wrong size) #25 0x00007ff6373a5432 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x5432)
    Why did you deprecate GCC? #26 0x00007ff6388cadd6 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x152add6)
    Why is native code compiled with -fno-strict-aliasing? #27 0x00007ff6378ed31d (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x54d31d)
    Unable to use Clang as part of Android Studio #28 0x00007ff6388ca711 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x152a711)
    r11b: ndk-which dosen't work #29 0x00007ff637a583b6 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x6b83b6)
    Missing 64 bit FILE stream functions #30 0x00007ff637a5862e (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x6b862e)
    armeabi libatomic.a uses ifuncs #31 0x00007ff637a72c9b (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x6d2c9b)
    clang doesn't make the difference between UL & ULL sufixes #32 0x00007ff6373a46be (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x46be)
    Cannot find module with tag 'cpufeatures' in import path #33 0x00007ff6373a1395 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x1395)
    clang doesn't export explicit specializations function templates #34 0x00007ff6373a14c8 (C:\Users\valle\AppData\Local\Android\Sdk\ndk\26.1.10909125\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe+0x14c8)
    Arm gdb missing #35 0x00007fff30c6257d (C:\WINDOWS\System32\KERNEL32.DLL+0x1257d)
    ndk r11b __cxxabi_config still missing #36 0x00007fff31faaa58 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x5aa58)
    clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
    Android (10552028, based on r487747d) clang version 17.0.2 (https://android.googlesource.com/toolchain/llvm-project d9f89f4d16663d5012e5c09495f3b30ece3d2362)
    Target: armv7-none-linux-android31
    Thread model: posix
    InstalledDir: C:/Users/valle/AppData/Local/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/windows-x86_64/bin
    clang: note: diagnostic msg:

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: C:/Users/valle/AppData/Local/Temp/ggml-58252a.c
clang: note: diagnostic msg: C:/Users/valle/AppData/Local/Temp/ggml-58252a.sh
clang: note: diagnostic msg:


[12/16] Building CXX object _deps/llama-build/common/CMakeFiles/common.dir/common.cpp.o
[13/16] Building CXX object _deps/llama-build/CMakeFiles/llama.dir/llama.cpp.o
ninja: build stopped: subcommand failed.

C++ build system [build] failed while executing:
@echo off
"C:\Users\valle\AppData\Local\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^
-C ^
"C:\Valle\dev\privateai\app\.cxx\Release\5u04g362\armeabi-v7a" ^
llama-android
from C:\Valle\dev\privateai\app
files.zip

Upstream bug

No response

Commit to cherry-pick

No response

Affected versions

r26

Canary version

No response

Host OS

Windows

Host OS version

Windows 11

Affected ABIs

armeabi-v7a

@ValleZ ValleZ added the bug label Feb 11, 2024
@pirama-arumuga-nainar
Copy link
Collaborator

Same as #1928. Should be fixed in r26c.

@DanAlbert
Copy link
Member

Which was released moments ago :)

@ValleZ
Copy link
Author

ValleZ commented Feb 12, 2024

Sweet, thank you!

@ValleZ
Copy link
Author

ValleZ commented Feb 12, 2024

Confirmed fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants