# Could not load library libcudnn\_cnn\_train.so.8. But I'm sure that I have set the right LD\_LIBRARY\_PATH

**URL:** <https://discuss.pytorch.org/t/could-not-load-library-libcudnn-cnn-train-so-8-but-im-sure-that-i-have-set-the-right-ld-library-path/190277>\
**Category:** autograd\
**Created:** [October 19, 2023, 9:56am UTC](https://discuss.pytorch.org/t/could-not-load-library-libcudnn-cnn-train-so-8-but-im-sure-that-i-have-set-the-right-ld-library-path/190277 "2023-10-19T09:56:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [October 19, 2023, 3:31pm UTC](https://discuss.pytorch.org/t/could-not-load-library-libcudnn-cnn-train-so-8-but-im-sure-that-i-have-set-the-right-ld-library-path/190277/2 "2023-10-19T15:31:55Z")

</div>

> [@lycnight](#):
>
> Moreover, I can even see the **libcudnn\_cnn\_train.so.8** right in the **/usr/local/cuda-12.1/lib64** , why can’t pytorch load it?

The PyTorch binaries ship with their own CUDA dependencies (including cuDNN), so remove your locally installed cuDNN (temporarily) from the library path and let PyTorch load it’s own libs.  
If you want to use your locally installed CUDA toolkit you could build PyTorch from source.

---

_[View the full topic](https://discuss.pytorch.org/t/could-not-load-library-libcudnn-cnn-train-so-8-but-im-sure-that-i-have-set-the-right-ld-library-path/190277)._
