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

**URL:** <https://discourse.julialang.org/t/multi-thread-julia-kernel-jupyter-fails-to-start-under-vscode-insiders/65436>\
**Category:** VS Code\
**Tags:** jupyter\
**Created:** [July 28, 2021, 1:03pm UTC](https://discourse.julialang.org/t/multi-thread-julia-kernel-jupyter-fails-to-start-under-vscode-insiders/65436 "2021-07-28T13:03:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrea\_Pagnani](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andrea_pagnani/32/3136_2.png) [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Post date:** [July 28, 2021, 1:03pm UTC](https://discourse.julialang.org/t/multi-thread-julia-kernel-jupyter-fails-to-start-under-vscode-insiders/65436/1 "2021-07-28T13:03:13Z")

</div>

Dear all …

As discussed in [https://github.com/microsoft/vscode-jupyter/issues/6803](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:

```julia
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

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [July 28, 2021, 4:20pm UTC](https://discourse.julialang.org/t/multi-thread-julia-kernel-jupyter-fails-to-start-under-vscode-insiders/65436/2 "2021-07-28T16:20:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Andrea\_Pagnani](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andrea_pagnani/32/3136_2.png) [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Post date:** [July 29, 2021, 5:53am UTC](https://discourse.julialang.org/t/multi-thread-julia-kernel-jupyter-fails-to-start-under-vscode-insiders/65436/3 "2021-07-29T05:53:30Z")

</div>

Thank you @davidanthoff

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

A

---

<div class="post-metadata">

**Author:** ![lewis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewis/32/5217_2.png) [@lewis](https://discourse.julialang.org/u/lewis)\
**Post date:** [September 20, 2022, 3:49pm UTC](https://discourse.julialang.org/t/multi-thread-julia-kernel-jupyter-fails-to-start-under-vscode-insiders/65436/4 "2022-09-20T15:49:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [September 20, 2022, 6:42pm UTC](https://discourse.julialang.org/t/multi-thread-julia-kernel-jupyter-fails-to-start-under-vscode-insiders/65436/5 "2022-09-20T18:42:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lewis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewis/32/5217_2.png) [@lewis](https://discourse.julialang.org/u/lewis)\
**Post date:** [September 20, 2022, 7:50pm UTC](https://discourse.julialang.org/t/multi-thread-julia-kernel-jupyter-fails-to-start-under-vscode-insiders/65436/6 "2022-09-20T19:50:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Andrea\_Pagnani](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andrea_pagnani/32/3136_2.png) [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Post date:** [September 23, 2022, 9:12am UTC](https://discourse.julialang.org/t/multi-thread-julia-kernel-jupyter-fails-to-start-under-vscode-insiders/65436/7 "2022-09-23T09:12:41Z")

</div>

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.
