Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eventhough interpereter is selected from Anaconda virtual environment, Jupyter notebook is stuck in detecting kernel loop #16051

Closed
2 tasks
amentes1 opened this issue Sep 15, 2024 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@amentes1
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

When I initially installed visual studio code with anaconda. I installed basic libraries for deep learning development such as tensor flow and jupyter notebook support both in anaconda virual env and visual studio code. I deleted the previous environment since it was not recognizing my gpu.I created a fresh env with tensorflow 2.10.0 and tensorflow-gpu and finally i could see my gpu recognized. However, I got stuck in Visual studio code. Eventhough I chose the conda virtual env interpreter the code is not running . When I run in my previously working jupyter notebook files, the notebook is stuck in detecting kernel loop. I use the same setup (my virtual environment exported as yaml) in my other notebook. But on this machine both vs code and jupyter extention gets stuck.

I tried cleaning cache, deleting environment and recreating, fresh install of anaconda and visual studio code.

I run the same environment and visual studio, anaconda, python versions in another computer.

VS Code Version

1.93.1

Jupyter Extension Version

2023.8.1

Jupyter logs

No output is given, the output window is stuck with clock icon saying pending

Coding Language and Runtime Version

python 3.9, tensorflow 2.10.0, notebook 7.2.2

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

24.5.0

Running Jupyter locally or remotely?

None

@amentes1 amentes1 added the bug Issue identified by VS Code Team member as probable bug label Sep 15, 2024
@karthiknadig
Copy link
Member

@amentes1 Can you share logs from Output > Python?

@shalev-habany
Copy link

I'm struggling with the same problem.
I used the vscode for couple years with jupyter notebook and apparently in the last update I have a problem that I choose the kernel and it just keep loading it (there are no logs with errors also I tried to change the log level of the jupyter to trace and still nothing).

@amentes1
Copy link
Author

Python output does not produce any logs. I temporarily solved the issue by switching to prerelease version of python extention. If I compile the same code in this extention, python doesnt see the gpu but somehow i can run it in jupyter-notebook now. I'm sharing the outputs for same code from jupyter and python.

import tensorflow as tf

if tf.test.is_gpu_available():
# Set GPU device
print('GPU available')

jupyter output:

WARNING:tensorflow:From C:\Users\Ozan\AppData\Local\Temp\ipykernel_28204\1265001584.py:3: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.config.list_physical_devices('GPU') instead.
GPU available

Python output:
PS C:\Users\Ozan\Desktop\training> & 'c:\Users\Ozan\anaconda3\envs\ozannewgpu\python.exe' 'c:\Users\Ozan.vscode\extensions\ms-python.debugpy-2024.10.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher' '55638' '--' 'C:\Users\Ozan\Desktop\training\gpu check.py'
2024-09-18 10:29:43.325177: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2024-09-18 10:29:43.334479: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
WARNING:tensorflow:From C:\Users\Ozan\Desktop\training\gpu check.py:3: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.config.list_physical_devices('GPU') instead.
2024-09-18 10:29:51.051157: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-09-18 10:29:51.106244: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2024-09-18 10:29:51.113671: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublas64_11.dll'; dlerror: cublas64_11.dll not found
2024-09-18 10:29:51.122679: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublasLt64_11.dll'; dlerror: cublasLt64_11.dll not found
2024-09-18 10:29:51.132678: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2024-09-18 10:29:51.142422: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
2024-09-18 10:29:51.151485: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusolver64_11.dll'; dlerror: cusolver64_11.dll not found
2024-09-18 10:29:51.162393: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusparse64_11.dll'; dlerror: cusparse64_11.dll not found
2024-09-18 10:29:51.172219: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found
2024-09-18 10:29:51.180853: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1934] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...

@DonJayamanne
Copy link
Contributor

@amentes1 I'm struggling to understand the problem at this stage, looks like you're running into a few issues or have been trying a few things, hence the confusion at my end

Please help me understand the following

  1. Are you debugging Python code in a Python file or Jupyter notebook?
  2. Does this work in Jupyter notebook in VS Code? (without debugging)
  3. Does this work in regular Python file in VS Code? (without debugging)
  4. My understanding is that it now works in Jupyter within VS Code, but not in Python

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Oct 28, 2024
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants