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: on Windows, it is getting very slow #1246

Open
mikbry opened this issue Sep 12, 2024 · 21 comments
Open

bug: on Windows, it is getting very slow #1246

mikbry opened this issue Sep 12, 2024 · 21 comments
Assignees
Labels
bug Something isn't working javascript Pull requests that update Javascript code rust Pull requests that update Rust code

Comments

@mikbry
Copy link
Contributor

mikbry commented Sep 12, 2024

Why multiple Webview threads ?

@mikbry mikbry added bug Something isn't working javascript Pull requests that update Javascript code rust Pull requests that update Rust code labels Sep 12, 2024
@mikbry mikbry self-assigned this Sep 12, 2024
@mikbry
Copy link
Contributor Author

mikbry commented Sep 20, 2024

Related to Webview2. clearing Users/xxx/AppData/Local/ai.opla.app/EBViewView fix a little...

@mikbry mikbry closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2024
@kustomzone
Copy link

kustomzone commented Sep 23, 2024

Missed the precise timing when this happened as i'm testing so many chat apps.
Removing EBWebView folder and installing the latest version didn't fixed it unfortunately.
Definitely a Webview2 issue. Causes my cpu to run between 10% - 30% utilization on the offending view.
When the server does finally start the view goes to a blank page or reports the page can't load.
Most of the apps i'm testing are Electron, but ollama-grid-search also uses Rust/WV2 and is okay. (both show 6 webviews in taskmanager)

Opla Webview2
Version: 128.0.2739.79
Modified: 12/09/2024

ollama-grid-search Webview2
Version: 128.0.2739.67
Modified: 05/09/2024

@mikbry
Copy link
Contributor Author

mikbry commented Sep 23, 2024

Thanks @kustomzone. Yes it is a WebView2 issue. On MacOs (ARM and x64) it is working correctly and memory usage is 10x lower... I see some comments about MS Office getting very slow and using a lot memory as it is also based on WebView2. Maybe it is due to latest Webview2 update. I Didn't find any relevant informations about that.
I will work on optimizing thread display.

@mikbry mikbry reopened this Sep 23, 2024
@kustomzone
Copy link

Sadly the docs are not much help as it just says Tauri takes care of it (on Win10) without stating any method to select a specific version: "On versions older than Windows 11 the installer generated by Tauri takes care of ensuring WebView2 is installed on the system." - https://v2.tauri.app/reference/webview-versions

@mikbry
Copy link
Contributor Author

mikbry commented Sep 24, 2024

@kustomzone I made some changes in event's handlers. Seems to work better on my low CPU PC running Win10.
Could you test again and give me your feedback thanks !

@mikbry
Copy link
Contributor Author

mikbry commented Sep 24, 2024

But there is still a memory leak on Windows

@kustomzone
Copy link

Thanks.
I'd switched Webview2 to the one Modified: 05/09/2024, but no improvement. Still using thou.
At some point llama.cpp.server.exe said ggml.dll & llama.dll were missing so i copied those to 'Program Files\Opla'
Now it gives an Entry Point error. Wrong location?
entry
After uninstall (+data), new install, it's stuck on "server is starting" while loading the last used model.
Interface still very slow to respond. I could download TinyLlama or select a model, but that's all atm.

@mikbry
Copy link
Contributor Author

mikbry commented Sep 24, 2024

Ok thanks that's another problem, I see new llama.cpp.exe needs extra dll. I created #1289

@kustomzone
Copy link

"From: Georgi Gerganov [email protected]
Date: Fri, 6 Sep 2024 13:47:27 +0300
Subject: [PATCH] llama : add new llama_perf API"
https://gitea.swigg.net/dustins/llama.cpp/commit/b2fc0f8596f3f46043303e0e7c055f1ad0a8290e.patch
Around the same date. When was your last update for llama.cpp.server.exe?

@mikbry
Copy link
Contributor Author

mikbry commented Sep 24, 2024

Yep 9 sep 2024I updated llama.cpp server

@mikbry
Copy link
Contributor Author

mikbry commented Sep 25, 2024

@kustomzone I fixed dll problems. On my old Xiaomi laptop Win10 4 cores m3-6Y30 1.51Ghz with only 4Gb TinyLlama is running barely smoothly now.

@mikbry
Copy link
Contributor Author

mikbry commented Sep 25, 2024

I found a strange behaviour between Opla and OpenAI providers screens. I created another issue #1295 for that

@kustomzone
Copy link

kustomzone commented Sep 25, 2024

Uninstalled, removed EBWebview folder, tried both exe (Program Files/) and msi (Users/) and both crash just when opening.
The new EBWebview folders are there, about 5 have contents, but the rest are empty. Only 13mb total. The one i've backed up is 84mb. Not sure why it's part installed.

Last Version says 129.0.2792.52. So does the backup.

@mikbry
Copy link
Contributor Author

mikbry commented Sep 25, 2024

Did you used https://github.com/Opla/opla/releases/tag/v1.0.0-alpha.230 ?
When I used exe version, install in c:/users/xxx/AppData/Local/Opla contains:

  • assets
  • ggml.dll
  • llama.cpp.server.exe
  • llama.dll
  • Opla.exe
  • uninstall.exe

Could you backup and delete c:/users/xxx/AppData/Roaming/Opla which contains all data. And restart and see if it works from a fresh start? Thanks

@kustomzone
Copy link

kustomzone commented Sep 25, 2024

Yeh, roaming is only one i didn't remove. Will try.
Yep, same app layout here. Oh, no assests folder!
Program Files has Uninstall Opla.lnk instead of exe, but they are identical otherwise.

@mikbry
Copy link
Contributor Author

mikbry commented Sep 25, 2024

Another hint, I use PowerShell to start Opla from c:/users/xxx/AppData/Local/Opla using this command:

& "./Opla.exe" | Out-Default

Which give me some logs and help me debug.

@mikbry
Copy link
Contributor Author

mikbry commented Sep 25, 2024

Strange I have an older version in Program Files without the dll... But this version is not used by the system.

@kustomzone
Copy link

When people switch between exe and msi it will confuse things a bit with different re-installs in both locations.

@mikbry
Copy link
Contributor Author

mikbry commented Sep 25, 2024

Yep I see

@kustomzone
Copy link

kustomzone commented Sep 25, 2024

Still no 'assets' folder in Program Files.
Now EBWebview is 5mb so it's crashing while writing those. Plenty of hdd etc.
It created 'Roaming\Opla\workspace\project.opla' but empty with crash.

PS C:\Users\Administrator\AppData\Local\Opla> & "./Opla.exe" | Out-Default Opla setup: project path="C:\\Users\\Administrator\\AppData\\Roaming\\Opla\\workspace/project" project path="C:\\Users\\Administrator\\AppData\\Roaming\\Opla\\workspace/project"

'c:\Program Files (x86)\Microsoft\EdgeWebView\Application'
EdgeWebView: 128.0.2739.79
Application: 129.0.2792.52

@mikbry
Copy link
Contributor Author

mikbry commented Sep 25, 2024

Oops assets wasn't present in windows bundle due to my previous changes for dll. I made a fix #1296 New release is on the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working javascript Pull requests that update Javascript code rust Pull requests that update Rust code
Projects
None yet
Development

No branches or pull requests

2 participants