matlab_kernel
matlab_kernel copied to clipboard
kernel keeps crashing
I am able to start a notebook and evaluate a few cells. But I usually can't get too far before the kernel crashes (there is no predictability to it). If I use Cell -> run all, it will die every time. The terminal window shows no error messages. Just notes that the kernel is restarting. Ideas ?
You can run jupyter notebook --debug
to get more error messages in the terminal. What versions of jupyter, matlab_kernel, and matlab are you running?
Thanks, I tried that and the random crash occurred again. Here is what I am seeing now in the terminal right before the crash:
Assertion failed: nbytes == sizeof dummy (/Volumes/100GB/conda/conda-bld/zeromq_1505916310977/work/src/signaler.cpp:206)
I can do all the same commands in Matlab directly with no issue. Sometimes I get further than this in the notebook.
Which version of zeromq
is this? conda info zeromq
.
4.2.1 if that helps. Thanks.
FYI, I used conda install zeromq=4.2.1 but that did not fix the issue. Same error message under the debug.
I ran the same notebook on my Windows device today. In runs perfectly. So it's something to do with my Mac.
I am starting to believe (but don't know for sure) that autosave is somehow related. Is there a way anyone knows to disable it when running a matlab kernel? There is no %autosave magic available
Here are the instructions for turning off autosave: https://stackoverflow.com/a/45980165/2814123
Thanks again. It appears that disabling the autosave has stopped the random crashing. Not perfect, but it's a work around for now. Going to leave this open though.
Crud! I spoke too soon. I just got further than ever before. Still crashes randomly.
Is there a lot of output associated with the cells?
Not really. In some cases, just simple evaluations.
Ah, it looks like this is a known issue with libzmq
on Windows: https://github.com/zeromq/libzmq/issues/1808
Thanks. I am not sure how to interpret that. I have a mac and I have a somewhat different error message (" nbytes == sizeof dummy" vs "Connection reset by peer"). I tried updating a few packages, but eventually that just prevented Jupyter from launching at all. So I reinstalled Anaconda but am back where I started: Matlab kernel randomly crashes (every few evaluations).
Does it happen if you use the Python kernel?
Near as I can tell, Python kernels are stable. Not had the issue
Yep, definitely a Matlab kernel thing.
Do you mind trying with Calysto Bash? It is also based on metakernel
, and we could narrow down our potential sources of error.
Thanks for continuing to help me. I installed Calysto Bash, but I am not sure to do from there. The notebook doesn't display output like in the sample notebook. I ran the command command jupyter notebook --debug in a cell and in the session thereby generated opened a notebook with the matlab kernel and evaluated cells until the crash occurred (never takes very long). Anyway, the cell is just showing a * instead of a number meaning that it's busy. But I don't know to do next.
Here is a screenshot.
Oh wow, you are quite right. Looks like that kernel needs some updating. In the mean time you could try https://github.com/Calysto/calysto_prolog.
Thank you again. I am not sure what I am supposed to do with a prolog kernel. One thing I did try tonight was to spend a good deal of time sending commands and variables to and from MATLAB via the matlab engine (using the console in Spyder). No crashes. So I am pretty sure it's related to either Jupyter or the kernel. But I thought I should check that it is not a bug in Python engine for matlab. I don't think it is. But of course, since the error is random, who knows? I just know the error happen frequent enough in Jupyter that I can get it to happens usually after less than 5 minutes.
I updated the bash kernel, if you'd like to give that a try again.
Hello I get the same error:
[D 12:20:20.395 NotebookApp] activity on c564caaa-43f2-403e-92a4-c890683b5ff7: execute_input
Assertion failed: nbytes == sizeof (dummy) (/Volumes/100GB/conda/conda-bld/zeromq_1505916310977/work/src/signaler.cpp:364)
It also crashes randomly when I try to execute a command on the matlab kernel
I also followed the instructions detaled above but I was not able to solve this
I'm running into the same problem, it looks a little bit different:
Assertion failed: nbytes == sizeof dummy (src/signaler.cpp:196)
I'm using a Linux system with Matlab 2016b, Python 3.5.4, installed using Miniconda. And the following Python packages: matlab-kernel==0.15.0 matlabengineforpython===R2016b metakernel==0.20.11 pyzmq==16.0.2
For me it's usable to some extent, sometimes I can use the notebook for an hour or so without issues, but sometimes it just crashes and does not recover for a while.
Apologies, I'm not sure what else to try and I don't have a Matlab license to try and reproduce.
I solved it by reinstalling zeromq, however not by pip install. This method of installation did not work for some reason. Follow it’s github instructions
@JuanRdBO Great news! We can put a note on the README. Can you say a bit about your situation? On WIndows? Which instructions did you follow? Was it this: https://github.com/zeromq/pyzmq/wiki/Building-and-Installing-PyZMQ#building-pyzmq-from-source
Also, how did you install jupyter? Do you use anaconda?
This issue occurred in a macbook pro mid 2012 with macOS High Sierra v. 10.13. I installed jupyter following the instructions on this github, so a standard installation. Then I installed the matlab kernel following this GitHub.
The solution was installing zeromq using the instructions provided here in zeromq.org's website. Actually it was just a line of code: brew install zmq
. After that i restarted jupyter and it worked fine. However, there are still crashes sometimes, but the amount of them has decreased to an acceptable value. I'd say one every 2 hours or so. When it crashes, it does not show any output (Even in debugging mode).
I had the same with my Macbook and Matlab R2017b installed on my machine. Apparently, running with --debug makes it more robus O_o. While before the kernel would crash every 3/4 minutes, now it still hasn't crashed yet.
Just to keep this issue alive, I can report that I have the same issue on my Mac with a similar set up to @JuanRdBO. @2dvisio's suggestion to run with --debug
doesn't appear to work for me.
It might be out there but I wonder if the issue is with the cases where the output is suppressed on Matlab. I ran the example notebook and noted that the crash always occurred around
b = a + 3;
So I removed the semicolon, re-ran and the notebook executed to the end without a crash.
Just a thought!
P.S. I am creating setup instructions (as a Jupyter notebook) for a class I am teaching in February. Here is a link to the notebook cpjobling/EG-247-Resources/setup.