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

kikit crash when trying to panelized PCB #694

Open
3 tasks done
kfirmaymon84 opened this issue May 22, 2024 · 14 comments
Open
3 tasks done

kikit crash when trying to panelized PCB #694

kfirmaymon84 opened this issue May 22, 2024 · 14 comments

Comments

@kfirmaymon84
Copy link

Prerequisites

  • I have read FAQ
  • I have searched existing issues (including closed ones)
  • 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

@thisisgregm
Copy link

Could be related to this issue:
#678
See my comment here:
#678 (comment)
I can see you use anchor: tl, the same as I did to reproduce my issue. No problems with other options for anchor.

@kfirmaymon84
Copy link
Author

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

@yaqwsx
Copy link
Owner

yaqwsx commented Jul 1, 2024

@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).

@JeremiahGillis
Copy link

JeremiahGillis commented Jul 19, 2024

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"
    }
}

@yaqwsx
Copy link
Owner

yaqwsx commented Jul 21, 2024

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?

@JeremiahGillis
Copy link

JeremiahGillis commented Jul 21, 2024

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
Copy link

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
Copy link

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.

@JeVetter
Copy link

JeVetter commented Oct 5, 2024

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

@Hyrla
Copy link

Hyrla commented Oct 22, 2024

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

@kfirmaymon84
Copy link
Author

kfirmaymon84 commented Oct 27, 2024

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.

@yaqwsx
Copy link
Owner

yaqwsx commented Oct 29, 2024

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?

@Hyrla
Copy link

Hyrla commented Oct 29, 2024

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

@yaqwsx
Copy link
Owner

yaqwsx commented Nov 13, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants