Bug 283470 - misc/llama-cpp: Illegal instruction without VULKAN
Summary: misc/llama-cpp: Illegal instruction without VULKAN
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL: https://github.com/ggerganov/llama.cp...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-21 13:39 UTC by mord0d
Modified: 2024-12-23 00:02 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mord0d 2024-12-21 13:39:47 UTC
The fix in #283205 make it worse.

It compiles, but now we have 'Illegal instruction' with ALL binaries.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2024-12-22 10:58:31 UTC
@mord0d,

Thanks for reporting this issue.

This is likely due to the same type of problem that causes this issue in misc/koboldcpp: https://github.com/LostRuins/koboldcpp/issues/1277 (kobold is derived from llama-cpp)

You must be using a really old CPU.

I will resolve this soon.
Comment 2 mord0d 2024-12-22 15:48:24 UTC
(In reply to Yuri Victorovich from comment #1)

> You must be using a really old CPU.

Not too old, it supports AVX (not AVX2 or AVX512, though):

 # grep CPU /var/run/dmesg.boot | head -n3
CPU: Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz (2700.11-MHz K8-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 48 CPUs
cpu0: <ACPI CPU> numa-domain 0 on acpi0

 # grep Features /var/run/dmesg.boot | head -n6
Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
Features2=0x7fbee3ff<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,DCA,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
AMD Features2=0x1<LAHF>
Structured Extended Features=0x281<FSGSBASE,SMEP,ERMS>
XSAVE Features=0x1<XSAVEOPT>

> I will resolve this soon.

Thank you.
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2024-12-23 00:01:19 UTC
The problem was actually caused by missing code for getting location of the currently running executabl, not by an old CPU.

It is now fixed.

Thanks for reporting the problem!
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-12-23 00:02:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c5e5e7e16df7c86c8e9f0091cfdfcf87e73571a5

commit c5e5e7e16df7c86c8e9f0091cfdfcf87e73571a5
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-12-22 23:58:24 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-12-23 00:01:24 +0000

    misc/llama-cpp: Fix regression in run-time

    ... caused by missing code to retrieve path
    to the currently running executable.

    PR:             283470
    Reported by:    mord0d@firemail.cc
    modified:   distinfo

 misc/llama-cpp/Makefile | 3 ++-
 misc/llama-cpp/distinfo | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)