# GPU-enabled training and testing in Windows 10

**URL:** <https://discuss.pytorch.org/t/gpu-enabled-training-and-testing-in-windows-10/143028>\
**Category:** windows\
**Created:** [February 1, 2022, 4:01pm UTC](https://discuss.pytorch.org/t/gpu-enabled-training-and-testing-in-windows-10/143028 "2022-02-01T16:01:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hjung](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/hjung/32/46057_2.png) [@hjung](https://discuss.pytorch.org/u/hjung)\
**Post date:** [February 1, 2022, 4:01pm UTC](https://discuss.pytorch.org/t/gpu-enabled-training-and-testing-in-windows-10/143028/1 "2022-02-01T16:01:15Z")

</div>

**In Windows 10** , my computer has NVIDIA driver 456.71 and I installed PyTorch using  
`conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch`

Then, I checked whether PyTorch used CUDA by typing the followings:

```auto
import torch
torch.cuda.is_available()

```

And it returned `True`.

It’s pretty weird to me because I’ve heard that we need to install both NVIDIA drivers and CUDA to use GPUs.

Thus, my question is: Can I use PyTorch and GPU-enabled training and testing without manually installing CUDA for Windows?

---

<div class="post-metadata">

**Author:** ![anantguptadbl](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/anantguptadbl/32/17784_2.png) [@anantguptadbl](https://discuss.pytorch.org/u/anantguptadbl)\
**Post date:** [February 1, 2022, 4:06pm UTC](https://discuss.pytorch.org/t/gpu-enabled-training-and-testing-in-windows-10/143028/2 "2022-02-01T16:06:26Z")

</div>

@hjung although you are getting `True` for `torch.cuda.is_available()`, without underlying nvidia drivers you will be unable to use it for tensor operations

There is an older thread discussing the same thing

> [@Is it required to set-up CUDA on PC before installing CUDA enabled pytorch?](https://discuss.pytorch.org/t/is-it-required-to-set-up-cuda-on-pc-before-installing-cuda-enabled-pytorch/60181):
>
> Can I simply go to pytorch website and use the following link to download a CUDA enabled pytorch library ? Or do i have to set up the CUDA on my device first, before installing the CUDA enabled pytorch ? pip3 install torch===1.3.0 torchvision===0.4.1 -f https://download.pytorch.org/whl/torch\_stable.html

---

<div class="post-metadata">

**Author:** ![hjung](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/hjung/32/46057_2.png) [@hjung](https://discuss.pytorch.org/u/hjung)\
**Post date:** [February 1, 2022, 4:22pm UTC](https://discuss.pytorch.org/t/gpu-enabled-training-and-testing-in-windows-10/143028/3 "2022-02-01T16:22:29Z")

</div>

@anantguptadbl From the link, it seems that the PyTorch installation command includes the CUDA _ **runtime** _, which I think is sufficient to use use GPUs for training and testing. Thus, we do not need to install manually CUDA for Windows.

Could you (or anyone) please correct me if I am wrong?

> [@Is it required to set-up CUDA on PC before installing CUDA enabled pytorch?](https://discuss.pytorch.org/t/is-it-required-to-set-up-cuda-on-pc-before-installing-cuda-enabled-pytorch/60181/19):
>
> No CUDA toolkit will be installed using the current binaries, but the CUDA runtime, which explains why you could execute GPU workloads, but not build anything from source.

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [February 1, 2022, 6:36pm UTC](https://discuss.pytorch.org/t/gpu-enabled-training-and-testing-in-windows-10/143028/4 "2022-02-01T18:36:18Z")

</div>

Yes, you are right and don’t need to install a local CUDA toolkit (just the drivers) unless you want to build PyTorch from source or a custom CUDA extension.
