question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python kernel still up after closing VSCode if extension host is on a linux machine

See original GitHub issue

Environment data

  • VS Code version: 1.54.3
  • Jupyter Extension version (available under the Extensions sidebar): v2021.3.619093157
  • Python Extension version (available under the Extensions sidebar): v2021.3.658691958
  • OS (Windows | Mac | Linux distro) and version: 20.04
  • Python and/or Anaconda version: Python 3.8.5 /conda 4.9.2
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
  • Jupyter server running: Local

Expected behaviour

Close python kernel.

Actual behaviour

Python kernel’s still up.

Steps to Reproduce:

  1. Open an ipython notebook
  2. Type the following
import torch

a = torch.ones((1,)).cuda()
  1. Close VSCode
  2. Open terminal
  3. nvidia-smi
  4. Check if any python process is consuming GPU memory

Gif:

bug_jupyter

Logs

N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
Aleko2286commented, Jun 29, 2021

The same thing is happening on my machine (Ubuntu 21.04), but it’s not limited to processes on the GPU.

I am only using interactive windows, but I suspect it’s the same issue.

Right now, when you run an interactive window, there will be 5 python processes, 2 of them being related to the kernel and 3 helpers. If you exit VS Code, it will shut down the 3 helper processes, but the 2 kernel processes will remain open. However, if you close the interactive window, VS code will shut down the kernel processes just fine (while the 3 helper processes remain). So the current work around for me is to first close the interactive window and only then close VS code.

1reaction
greazercommented, Jun 6, 2021

@goncamateus, we’ve made some significant changes to our notebook support. Can you try this scenario in VS Code insiders to see if it still repros?

Read more comments on GitHub >

github_iconTop Results From Across the Web

jupyter server : not started, no kernel in vs code - Stack Overflow
It seems that new dependencies came up with the latest update of python, which are not installed. For me this was pygments: jupyter-console...
Read more >
Remote Development FAQ - Visual Studio Code
Remote Development FAQ. This article covers frequently asked questions for each of the Visual Studio Code Remote Development extensions.
Read more >
Extension Host - Visual Studio Code
The Visual Studio Code Extension Host is responsible for managing extensions and ensuring the stability and performance of Visual Studio Code.
Read more >
Visual Studio Code June 2022
When closing the merge editor or accepting the merge, a warning is shown if not all conflicts have been addressed. The merge editor...
Read more >
Working with Jupyter Notebooks in Visual Studio Code
Connect to a remote Jupyter server; Debug a Jupyter Notebook. Setting up your environment. To work with Python in Jupyter Notebooks, you must...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found