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

I updated the repo and get this error "Tried architecture: x64-acc, System.Exception: Failed to load library x64-acc." #183

Closed
whynames opened this issue Jun 27, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@whynames
Copy link

Describe the bug

I updated the repo and get this error "Tried architecture: x64-acc, System.Exception: Failed to load library x64-acc." It was working fine before. I am on MacOS. I tried in multiple projects and same.

Steps to reproduce

No response

LLMUnity version

No response

Operating System

None

@whynames whynames added the bug Something isn't working label Jun 27, 2024
@amakropoulos
Copy link
Collaborator

Hi! Could you set the debug parameter and share the debug messages or Editor.log?

@whynames
Copy link
Author

Sure. There are multiple debug messages, same first two messages repeats for x64_acc too, it tries both of them.
Tried architecture: x64-no_acc, System.Exception: Failed to load library x64-no_acc. UnityEngine.Debug:Log (object) LLMUnity.LLM:StartLLMServer () (at ./Library/PackageCache/ai.undream.llm@3b17c4d415/Runtime/LLM.cs:261) LLMUnity.LLM/<Awake>d__40:MoveNext () (at ./Library/PackageCache/ai.undream.llm@3b17c4d415/Runtime/LLM.cs:216) System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<LLMUnity.LLM/<Awake>d__40> (LLMUnity.LLM/<Awake>d__40&) LLMUnity.LLM:Awake ()

/Users/botansahin/Documents/Documents/GitHub/AIResearch/Assets/StreamingAssets/undreamai-v1.1.5-llamacpp/macos-x64-acc/libundreamai_macos-x64-acc.dylib UnityEngine.Debug:Log (object) LLMUnity.LLMLib:.ctor (string) (at ./Library/PackageCache/ai.undream.llm@3b17c4d415/Runtime/LLMLib.cs:262) LLMUnity.LLM:InitLib (string) (at ./Library/PackageCache/ai.undream.llm@3b17c4d415/Runtime/LLM.cs:275) LLMUnity.LLM:StartLLMServer () (at ./Library/PackageCache/ai.undream.llm@3b17c4d415/Runtime/LLM.cs:247) LLMUnity.LLM/<Awake>d__40:MoveNext () (at ./Library/PackageCache/ai.undream.llm@3b17c4d415/Runtime/LLM.cs:216) System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<LLMUnity.LLM/<Awake>d__40> (LLMUnity.LLM/<Awake>d__40&) LLMUnity.LLM:Awake ()

LLM service couldn't be created UnityEngine.Debug:LogError (object) LLMUnity.LLM:StartLLMServer () (at ./Library/PackageCache/ai.undream.llm@3b17c4d415/Runtime/LLM.cs:265) LLMUnity.LLM/<Awake>d__40:MoveNext () (at ./Library/PackageCache/ai.undream.llm@3b17c4d415/Runtime/LLM.cs:216) System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<LLMUnity.LLM/<Awake>d__40> (LLMUnity.LLM/<Awake>d__40&) LLMUnity.LLM:Awake ()

@amakropoulos
Copy link
Collaborator

Thank you. Which mac do you have?
Could you share the "About This Mac" info?

@whynames
Copy link
Author

Screenshot 2024-06-27 at 17 11 59

There is also another debug message before them, but I am not sure if it is related to the issue, I will share anyways
Server command: -m "/Users/botansahin/Documents/Documents/GitHub/AIResearch/Assets/StreamingAssets/Phi-3-mini-4k-instruct-q4.gguf" -c 0 -b 512 --log-disable -np 1 --slot-save-path "/Users/botansahin/Library/Application Support/DefaultCompany/Temp" -ngl 32 UnityEngine.Debug:Log (object) LLMUnity.LLM:StartLLMServer () (at ./Library/PackageCache/ai.undream.llm@3b17c4d415/Runtime/LLM.cs:240) LLMUnity.LLM/<Awake>d__40:MoveNext () (at ./Library/PackageCache/ai.undream.llm@3b17c4d415/Runtime/LLM.cs:216) System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start<LLMUnity.LLM/<Awake>d__40> (LLMUnity.LLM/<Awake>d__40&) LLMUnity.LLM:Awake ()

@amakropoulos
Copy link
Collaborator

Could you also share the debug messages you get from the earlier LLMUnity version that was working for you?

@whynames
Copy link
Author

I already changed the repo, how can I revert back to that version, it was more than a month ago

@whynames
Copy link
Author

I found out. It was 1.2.7.
Editor.log
It gives many logs, and a lot of them are warnings, but it works
llama server listening at http://127.0.0.1:13333 UnityEngine.Debug:Log (object) LLMUnity.LLM:DebugLog (string,bool) (at ./Library/PackageCache/ai.undream.llm@dee6bda0dc/Runtime/LLM.cs:276) LLMUnity.LLM:CheckIfListening (string) (at ./Library/PackageCache/ai.undream.llm@dee6bda0dc/Runtime/LLM.cs:292) LLMUnity.LLMUnitySetup/<>c__DisplayClass1_0:<CreateProcess>b__0 (object,System.Diagnostics.DataReceivedEventArgs) (at ./Library/PackageCache/ai.undream.llm@dee6bda0dc/Runtime/LLMUnitySetup.cs:63) System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
Different from the previous it is listening after server command

@amakropoulos
Copy link
Collaborator

I found the problem, it has to do with the this llama.cpp issue: ggerganov/llama.cpp#7940 .
The build for x86 uses incorrecly the arm64 architecture.

I fixed it in my library.
Could you delete the Assets/StreamingAssets/undreamai-v1.1.5-llamacpp folder in your project and try again?
It will re-download the rebuilt library and should work 🤞 .

@whynames
Copy link
Author

Thanks a lot, it works now!

@amakropoulos
Copy link
Collaborator

Perfect, thanks for bringing it up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants