KiKit icon indicating copy to clipboard operation
KiKit copied to clipboard

kikit crash when trying to panelized PCB

Open kfirmaymon84 opened this issue 1 year ago • 27 comments

Prerequisites

  • [X] I have read FAQ
  • [X] I have searched existing issues (including closed ones)
  • [X] I use KiKit at least version 1.5.1 (older version are not supported)

KiKit version

1.5.1

KiCAD version

8.0.2

Operating system

Windows 11

Description

Hi, When I run kikit panelize, Screenshot 2024-05-22 143250

the "Running kikit widows freeze, Screenshot 2024-05-22 143304

after a couple of secoud, I got a message "Kicad PCB Editor 8.0.2 is not responding" Screenshot 2024-05-22 143332

if I close the program and open the PCB file I can see that the file is been penalized.

if I run kikit from CLI everything runs ok,

Steps to Reproduce

Just penalize PCB. EvoAcs_SideTouchSens.zip

kfirmaymon84 avatar May 22 '24 11:05 kfirmaymon84

Could be related to this issue: https://github.com/yaqwsx/KiKit/issues/678 See my comment here: https://github.com/yaqwsx/KiKit/issues/678#issuecomment-2094349259 I can see you use anchor: tl, the same as I did to reproduce my issue. No problems with other options for anchor.

thisisgregm avatar Jun 05 '24 16:06 thisisgregm

Dident help, I tried to do only panelized and it also happened. Screenshot 2024-06-20 104223

kfirmaymon84 avatar Jun 20 '24 07:06 kfirmaymon84

@kfirmaymon84: Could you try the upstream version? I am able to panelize the board with the upstream version of KiKit. So I would like to rule the possibility this issue is caused by your setup (e.g., Windows or dependencies mismatch).

yaqwsx avatar Jul 01 '24 07:07 yaqwsx

I am on Windows 11, KiCad 8.0.4, and KiKit 1.6.0. I can confirm that the GUI will lock up and eventually close.

image

I switched to the CLI and discovered another issue. The output kicad_pcb file will be blank if text is enabled and the anchor is set to tl. The output file works correctly when the anchor is set other points such as mt or tr.

I went back to the GUI and turned my text off, but KiCad will still lock up and eventually close.

I also see that KiKit now requires an output file in the GUI. If I set this to the currently opened file since I want the panel to show up like previous KiKit versions, KiCad will crash quickly after the "Running kikit" dialog opens. If I set the output file to something new, not opened, KiCad takes awhile to lockup an crash during panelization.

Since there is an output option in the GUI now, are you moving away from panelizating the currently opened file? IE You want to panelize the current open board?

Here is my JSON file:

{
    "layout": {
        "rows": "5",
        "cols": "2"
    },
    "source": {
        "tolerance": "10mm"
    },
    "tabs": {
        "type": "full"
    },
    "cuts": {
        "type": "vcuts"
    },
    "framing": {
        "type": "railslr",
        "hspace": "0mm"
    },
    "tooling": {
        "type": "4hole",
        "hoffset": "2.5mm",
        "voffset": "5mm",
        "size": "2mm"
    },
    "fiducials": {
        "type": "4fid",
        "hoffset": "2.5mm",
        "voffset": "10mm",
        "opening": "2mm"
    },
    "text": {
        "type": "simple",
        "hoffset": "2.5mm",
        "voffset": "140mm",
        "orientation": "90deg",
        "text": "JLCJLCJLCJLC",
        "anchor": "tl"
    },
    "page": {
        "type": "A2",
        "posx": "200mm",
        "posy": "50mm"
    }
}

JeremiahGillis avatar Jul 19 '24 20:07 JeremiahGillis

Since there is an output option in the GUI now, are you moving away from panelizating the currently opened file? IE You want to panelize the current open board?

No, the whole point of GUI existence is that people can quickly preview the panel and iterate to get the desired shape. PcbNew is used as a live preview of the panel. When you are satisfied with the result, you should get the penalization JSON and put it in your makefile or CI or another automated pipeline for building production files. GUI was never meant as a way of preparing manufacturing files. Unless something significantly changes in KiCAD, it will never be. KiCAD API is limited, and there are numerous aspects of the PCB we cannot modify via the API (e.g., sheet size, custom DRC rules, rules violation exclusions etc.). Therefore, KiKit parses and modifies the board, project, and schematic files. These changes cannot be brought to the "live view" provided by PcbNew. So when you save the board from preview, all of these features are missing, and the panels are not passing DRC or have other defects.

However, people insisted on saving the preview and using it for production. They were constantly reporting, "Hey, the panel from the GUI does not pass DRC!". Hence, I introduced the output file parameter in GUI in v1.6.0 to make them happy. They can use the GUI, they see live preview and they also get a file that is not damaged.

Back to the original issue, can you confirm that in v1.6.0:

  • the file panelizes just fine and in a reasonable time in CLI?
  • the panel takes forever/crashes in GUI?

So far, I struggle to reproduce the issue you report on both of my machines running Ubuntu 22.04 and Windows 11. The board panelizes just fine.

Is it possible that you output the panel to a network location? Or to a location handled by OneDrive cloud sync?

yaqwsx avatar Jul 21 '24 07:07 yaqwsx

Back to the original issue, can you confirm that in v1.6.0:

  • the file panelizes just fine and in a reasonable time in CLI?
  • the panel takes forever/crashes in GUI?

Yes, I just panelized four projects. My most complex only took 5 seconds. Like I mentioned before, the panel will be blank though if text is enabled and the anchor point is set to tl.

KiCad will crash with the exact same JSON file used in the CLI through the GUI.

Is it possible that you output the panel to a network location? Or to a location handled by OneDrive cloud sync?

My project is local, both the input and out, OneDrive is disabled. My local storage is a PCIe 4.0 NVMe.

I've spent some time this morning to see how I can help you replicate this. The GUI crashes for me with your basic example conn.kicad_pcb while using CLI command works fine.

CLI:

kikit panelize^
    --layout "rows: 2; cols: 2" ^
    --tabs "type: full" ^
    --cuts "type: vcuts" ^
    "C:\Users\jerem\Downloads\KiKit-master\LocalTest\conn.kicad_pcb" "C:\Users\jerem\Downloads\KiKit-master\LocalTest\panel.kicad_pcb"

GUI: KiKit Crash Sample Board 07212024

I have uninstalled KiCad 7.0.10, 8.0.4, and deleted the KiCad folder from my Documents which stores the plugins. After a fresh install of only 8.0.4, installing only the KiKit plug in and the backend, the sample above still crashes in the GUI.

Backend install log:

Successfully installed PrettyTable-0.7.2 PyMeta3-0.5.1 click-8.1.7 colorama-0.4.6 commentjson-0.9.0 euclid3-0.1 kikit-1.6.0 lark-parser-0.7.8 markdown2-2.5.0 pcbnewTransition-0.4.1 ply-3.11 pybars3-0.9.7 pypng-0.0.19 shapely-2.0.5 solidpython-1.1.3

Windows Info:

OS Name: Microsoft Windows 11 Pro
Version: 10.0.22631 Build 22631
Processor: AMD Ryzen 9 5950X 16-Core Processor, 3401 Mhz, 16 Core(s), 32 Logical Processor(s)
Installed Physical Memory (RAM): 64.0 GB
GPU: Nvidia RTX 3090, Driver Version 555.99

I have another Windows 11 and Windows 10 computer that I will test on and report back within the next day.

JeremiahGillis avatar Jul 21 '24 16:07 JeremiahGillis

I have the exact same behavior on my Windows 11 laptop. It works just fine in the CLI but not the GUI.

image

OS Name: Microsoft Windows 11 Pro
Version: 10.0.22631 Build 22631
Processor: 13th Gen Intel(R) Core(TM) i9-13900HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)
Installed Physical Memory (RAM): 64.0 GB
GPU: Nvidia RTX 4090, Driver Version 556.12

JeremiahGillis avatar Jul 22 '24 17:07 JeremiahGillis

My Windows 10 machine failed the first attempt, but worked every subsequent attempt. I went back to one of my Windows 11 machines for more testing via the GUI.

  1. The progress bar will not move and KiCad will crash with your repo conn.kicad_pcb file.
  2. If the conn.kicad_pcb file is opened, a dialog will prompt about different fills from previous KiCad version. If this is acknowledged, then saved for KiCad 8 format, KiKit panelization behavior is different. Now, KiCad will output a panel file correctly, the progress bar will move a little bit, then KiCad will hang and eventually crash. KiCad will not update the open file with a live preview of the panel. The panels settings are the same ones I used in the top of my post yesterday.
  3. I went back to Windows 10 following Step 2 and it still panelizes correctly in the GUI. However, if I try one of my private boards with my JSON file, it will act just like Windows 11 in Step 2. It will output a panel file correctly but lock up afterwards.

If it would help, I could create a private repo and invite you. Then you could try a problem layout file with my json config. You would need to delete this files once you were done testing. Just let me know if that would help.

JeremiahGillis avatar Jul 22 '24 20:07 JeremiahGillis

I have the same problem. The GUI is not freezing when my outputfile has another name, then the opened pcb file what is used as a preview . Typically it has the same name as the project file. I use : Win 11 Kikat 7.0.7 Kikit 1.6.0

JeVetter avatar Oct 05 '24 08:10 JeVetter

Hello, Same issue too. Win 11 Kicad 8.0.5 Kikit 1.6.0

Hyrla avatar Oct 22 '24 11:10 Hyrla

Still having the same problem, The workaround is to close the software and re-open the panel file. the panel file is made but the process is not finished.

Update: When run from CLI it works fine.

kfirmaymon84 avatar Oct 27 '24 12:10 kfirmaymon84

There is an experimental branch (https://github.com/yaqwsx/KiKit/tree/ui_stall) that could solve your issue. Could you try installing it via pip install https://github.com/yaqwsx/KiKit/archive/ui_stall.zip and test if it addresses this issue?

yaqwsx avatar Oct 29 '24 12:10 yaqwsx

There is an experimental branch (https://github.com/yaqwsx/KiKit/tree/ui_stall) that could solve your issue. Could you try installing it via pip install https://github.com/yaqwsx/KiKit/archive/ui_stall.zip and test if it addresses this issue?

Sadly even with this version the UI still crashes. Is there something particular to do to install this version appart from running this pip command and restarting kicad?

image

Hyrla avatar Oct 29 '24 13:10 Hyrla

@Hyrla: Just to be sure, do you follow the instructions for using Kikit correctly? That is:

  • opening a new window of Pcbnew (i.e., PCB editor) - directly from the start menu, not launching KiCAD.
  • then, you run the penalization from dialog from this window.

yaqwsx avatar Nov 13 '24 09:11 yaqwsx

@Hyrla: Just to be sure, do you follow the instructions for using Kikit correctly? That is:

* opening a new window of **Pcbnew** (i.e., PCB editor) - directly from the start menu, not launching KiCAD.

* then, you run the penalization from dialog from this window.

@yaqwsx Yes absolutely. This is not the first time I use KiKit, it worked for me like a charm few months ago on my previous project with KiCad 7.0

Hyrla avatar Nov 18 '24 19:11 Hyrla

Hmm, unfortunately, that means that I am out of ideas for the moment. Any change you work on a drive that is a network drive or a drive backed-up by OneDrive?

yaqwsx avatar Nov 18 '24 19:11 yaqwsx

Another me too.

Win 10 Kicad 8.0.8 Kikit 1.6.0

A few other points just in the case it helps identify the cause:

  • I hit the ufunc 'create_collection' not supported issue so ran the pip install kikit --force-reinstall to fix that.
  • My test pcb is a rectangle with two capacitors. No tracks or anything else so very simple.
  • Source and destination are in C:/Temp which is a local SSD.
  • Opening via Pcbnew or via Kicad causes the issue.
  • Panel is generated. It appears when I restart Pcbnew.
  • CLI works fine.

Shout if you would like me to test something here to help debug.

ColinBathe avatar Jan 27 '25 14:01 ColinBathe

@ColinBathe: Please, test the latest upstream version, not the stable one.

yaqwsx avatar Jan 27 '25 14:01 yaqwsx

@ColinBathe: Please, test the latest upstream version, not the stable one.

Is this the correct way of using the upstream version?

pip install https://github.com/yaqwsx/KiKit/archive/master.zip

If so, it hasn't fixed the issue.

ColinBathe avatar Jan 28 '25 14:01 ColinBathe

You can verify that either in the header of GUI or via kikit --version in terminal.

yaqwsx avatar Jan 28 '25 18:01 yaqwsx

This happens when the output file has the same name as the current blank PCB file, so don't do it like that.

Xiuyee-d avatar Mar 23 '25 09:03 Xiuyee-d

This happens when the output file has the same name as the current blank PCB file, so don't do it like that.

I give it a try and it's still crashing.

kfirmaymon84 avatar Jul 03 '25 18:07 kfirmaymon84

You can verify that either in the header of GUI or via kikit --version in terminal.

Can i do something to help resolve this problem, I can give you remote access if you want or can i run it in debug mode so i can see were is stuck? I'm electronic engineer and software is not my strong side but i can learn if needed.

I really love kikit.

kfirmaymon84 avatar Jul 03 '25 18:07 kfirmaymon84

@kfirmaymon84 Your original report is from the version 1.5.1. Does the problem persist even with the current upstream version?

yaqwsx avatar Jul 03 '25 19:07 yaqwsx

@kfirmaymon84 Your original report is from the version 1.5.1. Does the problem persist even with the current upstream version?

Yes, I tested it on different computers and it still crash. But if i run it from CLI its working ok.

kfirmaymon84 avatar Jul 03 '25 19:07 kfirmaymon84

We know that the GUI of KiCAD is not particularly ready for the replacement of the whole board, and the process can be inefficient. On every computer where I tested it, it was just slow (like 1-2 minutes), but it eventually finished. Let me think what can we log in order to understand what is different on your computer.

yaqwsx avatar Jul 03 '25 19:07 yaqwsx

Great, i will love to try and help. If you can tell me how to run it in debug mode i can try to help.

kfirmaymon84 avatar Jul 05 '25 12:07 kfirmaymon84