# CUDA Path Not Correctly Configured

**URL:** <https://discuss.pytorch.org/t/cuda-path-not-correctly-configured/63695>\
**Category:** Uncategorized\
**Created:** [December 11, 2019, 4:07am UTC](https://discuss.pytorch.org/t/cuda-path-not-correctly-configured/63695 "2019-12-11T04:07:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suzaku\_Kururugi](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/suzaku_kururugi/32/36798_2.png) [@Suzaku\_Kururugi](https://discuss.pytorch.org/u/Suzaku_Kururugi)\
**Post date:** [December 11, 2019, 4:07am UTC](https://discuss.pytorch.org/t/cuda-path-not-correctly-configured/63695/1 "2019-12-11T04:07:08Z")

</div>

Hello,  
I am trying to configure Pytorch with CUDA support. However, torch.cuda.is\_available() keeps on returning false.

Checking nvidia-smi, I am using CUDA 10.0. I modified my bash\_profile to set a path to CUDA.

```auto
export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64\{LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

```

When attempting to use CUDA, I received this error.  
`THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=50 error=30 : unknown error`

Is there some solution?

---

<div class="post-metadata">

**Author:** ![LeviViana](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/leviviana/32/9548_2.png) [@LeviViana](https://discuss.pytorch.org/u/LeviViana)\
**Post date:** [December 11, 2019, 8:41am UTC](https://discuss.pytorch.org/t/cuda-path-not-correctly-configured/63695/2 "2019-12-11T08:41:13Z")

</div>

You can always try to set the environment variable `CUDA_HOME`. By the way, one easy way to check if torch is pointing to the right path is

```python
from torch.utils.cpp_extension import CUDA_HOME
print(CUDA_HOME) # by default it is set to /usr/local/cuda/

```

---

<div class="post-metadata">

**Author:** ![Suzaku\_Kururugi](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/suzaku_kururugi/32/36798_2.png) [@Suzaku\_Kururugi](https://discuss.pytorch.org/u/Suzaku_Kururugi)\
**Post date:** [December 11, 2019, 7:46pm UTC](https://discuss.pytorch.org/t/cuda-path-not-correctly-configured/63695/3 "2019-12-11T19:46:19Z")

</div>

> [@LeviViana](#):
>
> from torch.utils.cpp\_extension import CUDA\_HOME

Interestingly, I got no CUDA runtime found despite assigning it the CUDA path. **nvcc** did verify the CUDA version.

---

<div class="post-metadata">

**Author:** ![LeviViana](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/leviviana/32/9548_2.png) [@LeviViana](https://discuss.pytorch.org/u/LeviViana)\
**Post date:** [December 11, 2019, 8:27pm UTC](https://discuss.pytorch.org/t/cuda-path-not-correctly-configured/63695/4 "2019-12-11T20:27:54Z")

</div>

That’s weird.

` CUDA_HOME=a/b/c python -c "from torch.utils.cpp_extension import CUDA_HOME; print(CUDA_HOME)"`

This prints `a/b/c` for me, showing that torch has correctly set the CUDA\_HOME env variable to the value assigned.

---

<div class="post-metadata">

**Author:** ![Suzaku\_Kururugi](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/suzaku_kururugi/32/36798_2.png) [@Suzaku\_Kururugi](https://discuss.pytorch.org/u/Suzaku_Kururugi)\
**Post date:** [December 11, 2019, 9:19pm UTC](https://discuss.pytorch.org/t/cuda-path-not-correctly-configured/63695/5 "2019-12-11T21:19:07Z")

</div>

It detected the path, but it said it can’t find a cuda runtime.

`No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-10.0'`

---

<div class="post-metadata">

**Author:** ![samm](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/samm/32/36169_2.png) [@samm](https://discuss.pytorch.org/u/samm)\
**Post date:** [April 18, 2021, 9:40pm UTC](https://discuss.pytorch.org/t/cuda-path-not-correctly-configured/63695/6 "2021-04-18T21:40:40Z")

</div>

excuse me did you solve it ?

---

<div class="post-metadata">

**Author:** ![Ensiyeh\_Raoufi](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ensiyeh_raoufi/32/70052_2.png) [@Ensiyeh\_Raoufi](https://discuss.pytorch.org/u/Ensiyeh_Raoufi)\
**Post date:** [May 17, 2024, 4:01am UTC](https://discuss.pytorch.org/t/cuda-path-not-correctly-configured/63695/7 "2024-05-17T04:01:33Z")

</div>

> [@LeviViana](#):
>
> CUDA\_HOME=a/b/c python -c “from torch.utils.cpp\_extension import CUDA\_HOME; print(CUDA\_HOME)”

Did you find the solution to this issue? I have the same problem. Thanks
