# Jupyter Notebook not detecting GPU

**URL:** <https://discourse.jupyter.org/t/jupyter-notebook-not-detecting-gpu/2272>\
**Category:** JupyterLab\
**Tags:** community\
**Created:** [September 30, 2019, 2:36pm UTC](https://discourse.jupyter.org/t/jupyter-notebook-not-detecting-gpu/2272 "2019-09-30T14:36:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![trekkat](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@trekkat](https://discourse.jupyter.org/u/trekkat)\
**Post date:** [September 30, 2019, 2:36pm UTC](https://discourse.jupyter.org/t/jupyter-notebook-not-detecting-gpu/2272/1 "2019-09-30T14:36:39Z")

</div>

We are running Jupyter application hosted on container(with base OS - ubuntu) on a VM server(CentOS). The GPU configuration seems fine as nvidia-smi and nvcc --version is working both on VM and as well as on container. But when I try the below block on jupyter, it’s returning ‘false’.

I am using TensorFlow commands to check GPU availability and its functionality.

```python
import tensorflow as tf
tf.test.is_gpu_available()
tf.test.is_built_with_cuda()

```

Calling those last 2 functions provides with “false”.

If anyone can give me any directions regarding this, I would really appreciate it!

---

<div class="post-metadata">

**Author:** ![rolweber](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/rolweber/32/657_2.png) [@rolweber](https://discourse.jupyter.org/u/rolweber)\
**Post date:** [October 1, 2019, 6:25am UTC](https://discourse.jupyter.org/t/jupyter-notebook-not-detecting-gpu/2272/2 "2019-10-01T06:25:06Z")

</div>

GPU support must be enabled when Tensorflow is built. You’re using a CPU-only build of Tensorflow, as indicated by the second function you called.

If you’re using conda, install tensorflow-gpu or tensorflow-gpu-base.

---

<div class="post-metadata">

**Author:** ![trekkat](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@trekkat](https://discourse.jupyter.org/u/trekkat)\
**Post date:** [October 1, 2019, 8:28am UTC](https://discourse.jupyter.org/t/jupyter-notebook-not-detecting-gpu/2272/3 "2019-10-01T08:28:47Z")

</div>

Hi rolweber!

Thanks for the response! I’ve got tensorflow-gpu 1.14.0, same version as that of tensorflow. Its installed but I still am getting that error. Do I have to use tensorflow-gpu instead of tensorflow in that above code that I’ve posted to make it work?

---

<div class="post-metadata">

**Author:** ![Jiitaksh](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jiitaksh](https://discourse.jupyter.org/u/Jiitaksh)\
**Post date:** [October 6, 2020, 8:33am UTC](https://discourse.jupyter.org/t/jupyter-notebook-not-detecting-gpu/2272/4 "2020-10-06T08:33:23Z")

</div>

Hey, i am also facing this error. Did you manage to solve this ?

---

<div class="post-metadata">

**Author:** ![0tist](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/0tist/32/3489_2.png) [@0tist](https://discourse.jupyter.org/u/0tist)\
**Post date:** [January 13, 2021, 10:31am UTC](https://discourse.jupyter.org/t/jupyter-notebook-not-detecting-gpu/2272/5 "2021-01-13T10:31:45Z")

</div>

Restarting the kernel, solved it for me.  
If its still not solved try rebooting the system.

---

<div class="post-metadata">

**Author:** ![ryzhiy](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/ryzhiy/32/13375_2.png) [@ryzhiy](https://discourse.jupyter.org/u/ryzhiy)\
**Post date:** [May 13, 2024, 3:02am UTC](https://discourse.jupyter.org/t/jupyter-notebook-not-detecting-gpu/2272/6 "2024-05-13T03:02:06Z")

</div>

My issue was with .env file which had CUDA\_VISIBLE\_DEVICES=XXXX. Once removed, the Jupyter notebook could access the GPUs.
