LostRuins / koboldcpp

A simple one-file way to run various GGML and GGUF models with KoboldAI's UI
https://github.com/lostruins/koboldcpp
GNU Affero General Public License v3.0
4.36k stars 312 forks source link

GUI broken on macos #834

Closed juhahalme closed 1 month ago

juhahalme commented 2 months ago

Hi,

After last update (1.64.1) GUI appears to be broken at least on MacOS. I have tried both intel and apple silicon and i get following error that keeps repeating:

2024-05-08 10:04:25.355 python[13315:99080] -[<CALayer: 0x6000032c6080> display]: Ignoring bogus layer size (100000.000000, 1144.000000), contentsScale 2.000000, backing store size (200000.000000, 2288.000000)

I can load models manually fine.

Best regards, Juha

LostRuins commented 1 month ago

Please try the latest release 1.65

juhahalme commented 1 month ago

Thank you for addressing this issue. With release 1.65 i don't get anymore any error messages, but GUI only shows black window.

LostRuins commented 1 month ago

can you take a screenshot? are you able to resize the window?

juhahalme commented 1 month ago

Here you go. No, resizing doesn't work.

Screenshot 2024-05-11 at 18 53 55
LostRuins commented 1 month ago

Oof yeah that is weird. Almost like there's something wrong with tkinter itself.

LostRuins commented 1 month ago

Hi, please check this out https://stackoverflow.com/questions/73056296/tkinter-on-mac-shows-up-as-a-black-screen

juhahalme commented 1 month ago

Yes, the problem is most likely in the tkinter. Unfortunately, I wasn't able to get it working with the tips from the link. I tried to install various version of Python, with no luck. Only thing that has worked for me is the suggestion in this reddit thread: https://www.reddit.com/r/SillyTavernAI/comments/1chlwn2/comment/l366q9k/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

LostRuins commented 1 month ago

Hmm, how would the suggestion work if min_width and min_height are not set? What did you set these values to?

juhahalme commented 1 month ago

Yes, that is not the right solution, but rather a workaround to the problem. Actually, simply deleting line 1571 (windowwidth = math.floor(original_windowwidth*smallratio), will do the same workaround (though with error: UnboundLocalError: cannot access local variable 'windowwidth' where it is not associated with a value).

I do not have experience in coding, so I cannot identify exactly the problem. However, I think it has something to do with the the resizability of the tkinker window not working correctly in macos (that was changed right?).

LostRuins commented 1 month ago

I have disabled window scaling on MacOS. Can you see if the latest version solves this issue?

juhahalme commented 1 month ago

This fixed the issue. Thank you!