Acly / krita-ai-tools

Krita plugin which adds selection tools to mask objects with a single click, or by drawing a bounding box.
GNU General Public License v3.0
373 stars 17 forks source link

Plugin crashes whole PC (Linux AND Windows, AMD Ryzen 5800X, AMD Radeon RX 6900 XT) #25

Closed rastla closed 1 month ago

rastla commented 1 month ago

Hi, I installed the plugin manually via the instructions (since the script doesn't seem to work any more (download link for Krita appimage is offline). However, when I click the new star brush, then my whole system crashes and restarts.

Are there any dependencies that I should install? Is AMD/ROCM unsupported and Nvidia/Cuda required?

I would post logs, but to be honest I don't know where to look for them :/

Tried it with Krita 5.2.2 and 5.2.3

//edit: Funnily enough, I also tried it in Windows 10 with Krita 5.2.2 and my PC also bluescreens in Windows when I click the brush :(

Acly commented 1 month ago

Are you using the GPU mode explicitly? Ie. from the tool options use enable it via GPU button?

I would recommend to always use CPU, especially on Linux. GPU will only work with a bunch of dependencies installed. Also I don't have an AMD card, so can't test RocM... but I'm also pretty sure it isn't supported in the first place.

From your description though it sounds like you don't even get to the point where you can access tool options, so it's probably just CPU.

There aren't any tool-specific logs. I have no idea why it would crash the system or BSOD. Can you check the system logs? On Windows Event Viewer should log the cause of the bluescreen.

My only guess is that your CPU supports more instruction sets than most, and something like incorrectly used AVX2 instruction is causing the crash. In that case upgrading to a newer ONNX runtime might help: https://github.com/microsoft/onnxruntime/releases Windows: download onnxruntime-win-x64-1.18.1.zip and extract lib/onnxruntime.dll to your-krita/bin (overwrite). I just briefly tried that and it still works.

rastla commented 1 month ago

Wow, thanks! That aktually worked for Windows. :smile:

Now the question how to fix this for Linux. Just removing the 1.15.1 libs from ~/Projects/CustomKrita/squashfs-root/usr/lib/kritaplugins/toolsegmentation and adding the 1.18.1 instead doesn't quite work, because then I get an error at startup that the 1.15.1 library is missing. I even tried cloning the dlimgedit repo, modified this line to download 1.18.1 instead: https://github.com/Acly/dlimgedit/blob/main/depend/onnx/CMakeLists.txt#L42 and rebuilt it and tried to do it with those libraries, but still it crashed on Linux :/

//edit: I spoke too soon... It works sometimes in Windows. The next time the system crashes again. Not sure why... Can't see anything useful in the event viewer and for some reason I get no bluescreen dumps

//edit 2: Oh damn, you mentioned CPU instructions. So I thought, what the hell, let's see if there's a new BIOS Update available (there were like 7 newer versions than the one I had (Asus B550 Plus - Version 1804 from 2021)). After the newest available BIOS update, it seems like it works on Windows and Linux now. Thank you again! And sorry for wasting your time

Acly commented 1 month ago

At least you now have proof all those fancy features of your CPU are being put to good use!