When I install SlicerJupyter and run it, it tries to connect and the dies. The messsage ist: “The kernel appears to have died. It will restart automatically.” It then restarts and dies again.
This happens both when I’m using standalone Slicer/Jupyter or Docker image.
I feel hopeless.
The other message is: “A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.”
What I found to be strange is that Slicer app repeatedly starts and closes. After I close it, and shutdown jupyter I still have like 4 Slicer processes.
It’s strange to me that the same error is when I’m using docker and standalone app.
So below is the application log. I noticed that there’s a message ‘device not open’:
QIODevice::read (QFile, “/home/mikolaj/.config/NA-MIC/Extensions-29402/SlicerJupyter/share/Slicer-4.11/qt-loadable-modules/JupyterKernel/Slicer-4.11/kernel-template.json”): device not open
apart from that, standard message about abnormal exit:
Ad) Can you check if you can find logs of a Slicer instance that the notebook server started?
So I went to /tmp/Slicer-mikolaj (I believe this is where logs are stored) and after few minutes of running slicer with jupyter server (started from slicer standalone app with extension) I have 12 separate files. I think this is because something is spawning slicer app processes. I see a Slicer window popup for a second and then it shuts down. after about 10 seconds it happens again - Slicer window pops up and closes. This happens ad infinitum until I go to htop and kill every process that has ‘slicer’ in it (there are usually like maybe 6 or more simultanious processes).
Those are the files:
Slicer_29402_20201209_195740_529.log , Slicer_29402_20201209_200027_758.log, Slicer_29402_20201209_200050_524.log etc
Or like this:
[DEBUG][Python] 09.12.2020 20:02:28 [Python] (/home/mikolaj/Downloaded_Programs/Slicer-4.11.20200930-linux-amd64/lib/Python/lib/python3.6/site-packages/pydicom/datadict.py:432) - Reversing DICOM dictionary so can look up tag from a keyword…
And I have 5 log files with the shorter version and 6 log files with longer version
Launching of Slicer processes is expected, it means that the kernel is successfully registered to the jupyter server and the jupyter server attempts to start the kernel (=Slicer application).
Have you launched the server? You should only see Slicer instances popping up after you open a notebook with Slicer kernel. If you see Slicer instances started before that then it means that you have Jupyter server(s) running in the background. You can find and kill all Jupyter server instances or just reboot your computer to get rid of them.
How things should work:
Start Slicer, go to JupyterKernel module, click on “Start Jupyter server” => after a minute or so, your browser is opened (http://localhost:8888/tree) and you see the Jupyter server web interface
Create a notebook, choose Slicer 4.11 as kernel (or 4.13 if you use latest preview release) => a new notebook is created, a Slicer instance is launched
The Jupyter server launches Slicer with a command like this:
Start Slicer, go to JupyterKernel module, click on “Start Jupyter server” => after a minute or so, your browser is opened ( http://localhost:8888/tree ) and you see the Jupyter server web interface
Create a notebook, choose Slicer 4.11 as kernel (or 4.13 if you use latest preview release) => a new notebook is created, a Slicer instance is launched
This is exactly what I did. However, after I create a notebook and choose slicer 4.11 as kernel I get message that the kernel died and it will restart. A slicer instance window pops up and briefly closes. It then goes on and on like this (restarting kernel, problem with connection to kernel, slicer window up and down, restarting).
What I think it should do, is that jupyter notebook should stay connected to the Slicer kernel and allow me use it. Instead it looses connection and restarts.
I can’t interact with instances of Slicer that pop up, because after a second they disappear. I can only interact with instance of Slicer that I run with ./Slicer
The same behaviour is also inside docker container.
OK, this is pretty good. The next step is to see why startup fails:
A. because Slicer crashes at startup, when it starts the kernel (e.g., due to conflicts with some system libraries)
B. because the server cannot connect to the kernel (e.g., due to network access issues).
If you launch Slicer and launch a kernel manually and it crashes then we know it is A, otherwise it is B.
Yes, you can use standard linux tools to get stack trace of the crash. I don’t use linux much, so I don’t know the details. Maybe @RafaelPalomar can help.
Invalid opcode means the CPU encountered an invalid instruction. It may be due to data corruption/incorrect loading, but there is a chance that your CPU actually does not recognize the instruction.
Do you run on a physical computer or in a virtualized environment? What is your CPU model?