jupyter-xeus / xeus-octave

Jupyter kernel for GNU Octave
https://xeus-octave.readthedocs.io/
GNU General Public License v3.0
57 stars 10 forks source link

what(): feval: function 'graphics_toolkit' not found #98

Open OliverKleinBST opened 1 year ago

OliverKleinBST commented 1 year ago

Description

When opening octave as Jupyterlab Notebook deployed as JupyterHub the kernel is crashing. When I run the same container manually and just run jupyter lab the Notebook and Octaver kernel is working as expected.

Logs: [D 2023-01-20 00:22:44.346 SingleUserLabApp manager:388] Starting kernel: ['/opt/conda/bin/xoctave', '-f', '/home/jovyan/.local/share/jupyter/runtime/kernel-a3e90551-2faa-4658-9417-f674c4cc7db2.json'] [D 2023-01-20 00:22:44.347 SingleUserLabApp connect:604] Connecting to: tcp://127.0.0.1:41797 GLFW Error: X11: The DISPLAY environment variable is missing (65544) Cannot initialize GLFW terminate called after throwing an instance of 'octave::execution_exception' what(): feval: function 'graphics_toolkit' not found

What I Did

Open xoctave notebook.
rapgenic commented 1 year ago

I think this is because at the moment xeus-octave needs an X server to run.

We have solved this problem in our Binder demo by using xvfb-run, which creates a virtual X server.

If you're using a custom Dockerfile I'd suggest adding a line to install xvfb via apt, and then replacing the default

CMD ["start.sh"]

With something like

CMD ["xvfb-run start.sh"]

Note that I have not tested this specifically so you might need some trial and error to get this right.

An alternative could be creating editing the kernel.json file (which I think will be located in /opt/conda/share/jupyter/kernels/xoctave/kernel.json) and replace the:

  "argv": [
      "/opt/conda/bin/xoctave",
      "-f",
      "{connection_file}"
  ],

with something like:

  "argv": [  
      "/usr/bin/xvfb-run",
      "/opt/conda/bin/xoctave",
      "-f",
      "{connection_file}"
  ],

(Also not tested directly)

jamarier commented 1 year ago

Hi, I have same problem.

I looked for a Docker image with jupyter and xeus-octave, but I couldn't find any so I create mine.

My docker file is here. Dockerfile.txt

I tried both approaches: modify kernel file description and command in docker file without success.

Is there any working dockerfile of jupyter with xoctave?

Edited: I forget to mention: my host machine has an nvidia graphic card but I am using docker (without docker-nvidia or other specialized versions for nvidia).

jimdelois commented 3 days ago

Has anyone made any progress on this issue?

I have been trying for several days to create an image that uses xeus-octave (downstream of Jupyter's preconfigured images), but have had zero luck whatsoever.

I have tried all of the methods mentioned in this thread, as well as other techniques suggested in related GH Issues in this repo, but still no luck.

Offering advice as to what might work, while generous, only causes consumers to uselessly spin their wheels forever when it turns out not to be the solution. I'm curious to know if there is anyone who has actually managed to get xeus-octave working within a Dockerized setup...