Simulation Error(s), problem with UNC path on a network drive

I have two general problems regarding simulation:

  1. The ERC gives me the unhelpful message “SPICE model issue” every time I run it, on any schematic. There is no correlation with whether or not the simulation runs. What does this mean?
  2. In the last two days, every time I attempt to run a simulation, even on a schematic which I have successfully simulated in the past, I get the following error message:

Error: .include filename missing
Error: ngspice.dll cannot recover and awaits to be detached
Note: can’t find the initialization file spinit.

** ngspice-40 shared library
** Creation Date: May 18 2023 08:17:00

Note: No compatibility mode selected!
Circuit: *
Warning: No job (tran, ac, op etc.) defined:
run simulation not started

What gives?

Buggy input.

To be more serious: What is the KiCad version, what is the operating system?
What did you do to your files system in the last two days? Did you change path names?

I have found an answer to my second question. Apparently, it is not enough to specify the full path to an added library in the “Simulation Model”. When I changed everything back to built-in KiCad simulation models, I could get the simulation to run again.
The relevant topics I have found:

don’t say anything about simulation model libraries, but I copied all of my 3d party simulation libraries into the path given in the Preferences for KICAD7_3RD_PARTY and assigned the models from there.
That seems to have solved the 2nd problem.
I would still be grateful for an answer to the first.

I am using KiCad 7.0.6 running under Windows 10 Pro 22H2, build 19045.3448.

Is there a way to assign the models without copying the libraries in to the Path in Preferences?
I copied my 3rd Party libraries into the Symbols Folder of KiCad and the Simulation worked. Thank you for that!
But i would like to keep the libraries in another Folder.
Is there an include-Command or something so that i can keep the libraries in a separte folder and assign the models from there?

What libraries are you talking about? Spice model libraries?

KiCad 7.0.9 on MS Windows, attaching a model to a symbol:
Double click onto the symbol on the Eeschema canvas. ‘Symbol Properities’ window opens.
Simulation Model… → Spice model from file → Click on rightmost button (the file selection tab) → Browse Models window opens → select a suitable folder → select the file containing the model

This is working with the model file in whatever path and folder.

Thank you for your reply.
I did not write the libraries myself so i dont know much about them im sorry, but it says EESchema Library Version 2.4 .
I did what you said and attached the Models to my Symbols. But it only worked for the Simulation, if my Library was in the path that was designated in my Preferences. In my Example, my designated Path was in KiCad/share/Symbols. I moved my library there, assigned my Models from there and it worked.
But assigning the models from the original Folder did not work.

May I suggest that you have a look at the tutorial KiCad Eeschema as GUI for ngspice, tutorial for setting up the simulation. It is written for KiCad6, but should be valid for version 7 as well.

This library is a symbol librarry for Eeschema, not connected to ngspice. In addition you need a spice model (in a library or file) to enable the simulation. KiCad/ngspice does not offer spice simulation libraries. You have to search for them, see Spice models and model parameters for ngspice circuit simulator or other sources in the web.

Thank you i will try that. But why is the Simulation working when i move my library into the KiCad Symbols folder and assign the Simulation Models from there instead of the original Folder?

Maybe my Error Message helps too.
Still found no Solution. Thank you!

With the error message
Error: .include filename missing
ngspice reports that Eeschema has sent a line
to ngspice, where the file name after .include is missing.

If using a network drive to store the models, it may happen (under MS Windows) that the network drive name (the UNC path), originally starting with \\ , is sent to ngspice as //.

So we have a line
.incluce //patname/filname

which by ngspice is read as
because everything starting with // is seen as a comment.

(See also my comment below)

You may check (copy and post here) the ngspice netlist, sent to ngspice by Eeschema, (after having loaded your circuit into Eeschema) by
Eeschema → Inspect → Simulator → Simulation → Show SPICE netlist
And you may compare the netlists, when having your models in your original folder, or after copying them into the local folder.

What is the name of the original folder?

Hmmm, if your “original Folder” is a network drive (you did not tell us anything about it), and you have started its name with //… , then the above problem may immediately surface up.

// is used by ngspice as a end-of-line comment delimiter, that is everything following a // is read as a comment and is discarded when creating the netlist.

The official definition for UNC path names on Windows is that they start with \\. This is what ngspice is expecting.

This issue has been discussed already in Simulation does not work with UNC paths (#15753) · Issues · KiCad / KiCad Source Code / kicad · GitLab, but there seems to be no solution yet. I will add a note to the gitlab issue.


I can easily run a simulation with model libraries stored on a network drive (even with remote vpn) under MS Windows (e.g. stored at \\drive1\holger\models) by using the Windows command “Netzlaufwerk verbinden” or “connect network drive” to give the network drive \\drive1\holger a name (a new drive letter, e.g. Z) on my computer. Then after attaching the model to the symbol, there is no problem any more with // or \\, because the model is located in "Z:/models".

Thank you very much for your time and your reply Holger.
I am sorry for the delay ,i am only 2 times a week in the Office, and the insufficient report, i am working on a simplified Circuit to investigate and share the Problem correctly.
I be back and working on this in the new year, wish you blissful days.

Happy new Year!

As you said holger, my „original Folder“ is on a Network drive.

I created a simple Transistor Test Circuit ( it is for documental purposes only ) and moved the Project to C:/Users/…/ and opened it .Then i attached the simulation Model of the Transistor from there.
This is the Netlist.

As You said, the .include line is correct and the Simulation is working without Errors.

Then i opened the Project from the etwork drive and attached the simulation Model of the Transistor from there.
This is the Netlist.

As you suggested, the UNC Path sent to ngspice by EEschema begins with “// so ngspice sees it as a comment.

As you said, that is why the Error Message ( in my Comment above) is „file name missing“.

I am still using Windows 10 and KiCad 7.0.9.

This really is exactly the same Problem as stated in the Gitlab Forum that you posted the link to.

The way to test this is the same that cpresser in Gitlab said, but if you want to test it with my files i can upload them here.

Is there a way to fix this without the „connect Network Drive“ command?

Thank you very much, i hope i reported this problem this time correctly.