Multi thread julia kernel (jupyter) fails to start under vscode (insiders)

Dear all …

As discussed in https://github.com/microsoft/vscode-jupyter/issues/6803, it seems that I am not able to run a multi-julia thread kernel under VSCODE using Jupyer app of VSCODE Insiders.

  • VS Code version: 1.59.0-insider (Universal)
  • Jupyter Extension version (available under the Extensions sidebar): v2021.8.1055544705
  • Python Extension version (available under the Extensions sidebar): v2021.7.1060902895
  • OS (Windows | Mac | Linux distro) and version: MAC OS X BigSur
  • Python and/or Anaconda version: Python 3.8.8 (default, Apr 13 2021, 12:59:45)

The step to reproduce the problem are the following:

using IJulia
installkernel("Julia_8_threads", env=Dict("JULIA_NUM_THREADS"=>"8"))

Jupyter: Create new blank notebook (from VSCODE) → set kernel to Julia_8_threads.

The kernel does not start: Timed out waiting to get a heartbeat from kernel process.
Single threaded notebooks are ok.
Finally please note that if I run the kernel in chrome (with IJulia) the 8 thread kernel works perfectly

From a discussion with @rchiodo,

According to the kernel API, they should return a heartbeat whenever we [ping ](https://jupyter-client.readthedocs.io/en/stable/messaging.html#heartbeat-for-kernels)the heartbeat port. And it does with single threaded mode. I don't know why it's not in multithreaded mode. Might be a bug in the kernel.

Is this something worth reporting as an IJulia issue?

A

Not entirely sure, but we’re shipping our native integrated Jupyter Notebook support today that completely circumvents IJulia.jl. In principle that should be more stable, but in practice it doesn’t support multi threading yet.

Thank you @davidanthoff

I’ll try the new release. Thanks for your work!

A

But, this won’t work in Github Codespaces will it?

The native Jupyter kernel story should work on GitHub Codespaces in theory, in practice I haven’t tried it, though.

I have solved this. Please close. Turns out that Threads setting cannot be a command line argument in a kernelspec. Must be in the env Dict argument.

I confirm that now Jupyter notebook from VS Code with native integrated Jupyter Notebook support supports multi-threading.

  • VS Code Version: 1.71.2
  • Julia 1.7.3

Thanks a lot.

I am closing the thread as solved.