Import torch fails with fresh conda installation

username: EricF
cooked: <p>My OS is Ubuntu 22.04</p>
<p>I only install anaconda from Anaconda3-2022.10-Linux-x86_64.sh<br>
And then run conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia</p>
<p>import torch gives<br>
File “/home/fenaux/anaconda3/lib/python3.9/site-packages/torch/<strong>init</strong>.py”, line 191, in <br>
_load_global_deps()</p>
<p>File “/home/fenaux/anaconda3/lib/python3.9/site-packages/torch/<strong>init</strong>.py”, line 153, in _load_global_deps<br>
ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)</p>
<p>File “/home/fenaux/anaconda3/lib/python3.9/ctypes/<strong>init</strong>.py”, line 382, in <strong>init</strong><br>
self._handle = _dlopen(self._name, mode)</p>
<p>OSError: libcufft.so.10: cannot open shared object file: No such file or directory</p>
<p>when I check in anaconda3/lib I only find libcufft.so.11<br>
I also tried with<br>
conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia<br>
an d result is exactly the same<br>
I have no other environment and no other installation of pytorch</p>
<p>Thanks for helping me</p>

username: EricF
cooked: <p>I made a new installation<br>
After anaconda installation I ran<br>
<code>conda install -c "nvidia/label/cuda-11.7.1" cuda-toolkit</code><br>
and notice that the associated package include libcufft-10.7.2.91<br>
then conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia</p>
<p>import torch</p>
<p>torch.version.cuda<br>
Out[4]: ‘11.7’</p>
<p>torch.backends.cudnn.enabled<br>
Out[5]: True</p>
<p>but …<br>
torch.cuda.is_available()<br>
Out[2]: False</p>
<p>And I still have the problem after rebooting my computer</p>

username: ptrblck
cooked: <p>This should be fixed via <a href="https://github.com/pytorch/builder/pull/1227">this PR</a> so you could use the current nightly or re-download the package.</p>

username: EricF
cooked: <p>Thanks for your answer<br>
I reinstalled anaconda as before and the directly</p>
<p>conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch-nightly -c nvidia</p>
<p>then import torch is ok <img src="https://discuss.pytorch.org/images/emoji/apple/+1.png?v=12" title=":+1:" class="emoji" alt=":+1:" loading="lazy" width="20" height="20"><br>
but I still have the problem with cuda<br>
torch.cuda.is_available()<br>
Out[3]: False</p>
<p>torch.backends.cudnn.enabled<br>
Out[2]: True</p>
<p>system knows the GPU</p>
<blockquote>
<blockquote>
<blockquote>
<p>lspci | grep -i nvidia<br>
01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB] (rev a1)<br>
01:00.1 Audio device: NVIDIA Corporation GA104 High Definition Audio Controller (rev a1)</p>
</blockquote>
</blockquote>
</blockquote>
<p>but<br>
nvidia-smi<br>
commande « nvidia-smi » not found but maybe installed with :<br>
sudo apt install nvidia-utils-390         # version 390.157-0ubuntu0.22.04.1, or<br>
sudo apt install nvidia-utils-450-server  # version 450.216.04-0ubuntu0.22.04.1<br>
sudo apt install nvidia-utils-470         # version 470.161.03-0ubuntu0.22.04.1<br>
sudo apt install nvidia-utils-470-server  # version 470.161.03-0ubuntu0.22.04.1<br>
sudo apt install nvidia-utils-510         # version 510.108.03-0ubuntu0.22.04.1<br>
sudo apt install nvidia-utils-515         # version 515.86.01-0ubuntu0.22.04.1<br>
sudo apt install nvidia-utils-515-server  # version 515.86.01-0ubuntu0.22.04.1<br>
sudo apt install nvidia-utils-525         # version 525.60.11-0ubuntu0.22.04.1<br>
sudo apt install nvidia-utils-418-server  # version 418.226.00-0ubuntu4<br>
sudo apt install nvidia-utils-510-server  # version 510.47.03-0ubuntu3</p>
<p>restart my computer doesn’t change anything</p>

username: EricF
cooked: <p>I do not know if that help, some additionnal informations<br>
$ python -m torch.utils.collect_env<br>
Collecting environment information…<br>
PyTorch version: 2.0.0.dev20221210<br>
Is debug build: False<br>
CUDA used to build PyTorch: Could not collect<br>
ROCM used to build PyTorch: N/A</p>
<p>OS: Ubuntu 22.04.1 LTS (x86_64)<br>
GCC version: Could not collect<br>
Clang version: Could not collect<br>
CMake version: Could not collect<br>
Libc version: glibc-2.35</p>
<p>Python version: 3.9.13 (main, Aug 25 2022, 23:26:10)  [GCC 11.2.0] (64-bit runtime)<br>
Python platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.35<br>
Is CUDA available: False<br>
CUDA runtime version: 11.7.99<br>
CUDA_MODULE_LOADING set to: N/A<br>
GPU models and configuration: Could not collect<br>
Nvidia driver version: Could not collect<br>
cuDNN version: Could not collect<br>
HIP runtime version: N/A<br>
MIOpen runtime version: N/A<br>
Is XNNPACK available: True</p>
<p>Versions of relevant libraries:<br>
[pip3] mypy-extensions==0.4.3<br>
[pip3] numpy==1.21.5<br>
[pip3] numpydoc==1.4.0<br>
[pip3] torch==2.0.0.dev20221210<br>
[pip3] torchaudio==0.14.0.dev20221212<br>
[pip3] torchvision==0.15.0.dev20221212<br>
[conda] blas                      1.0                         mkl<br>
[conda] mkl                       2021.4.0           h06a4308_640<br>
[conda] mkl-service               2.4.0            py39h7f8727e_0<br>
[conda] mkl_fft                   1.3.1            py39hd3c417c_0<br>
[conda] mkl_random                1.2.2            py39h51133e4_0<br>
[conda] numpy                     1.21.5           py39h6c91a56_3<br>
[conda] numpy-base                1.21.5           py39ha15fc14_3<br>
[conda] numpydoc                  1.4.0            py39h06a4308_0<br>
[conda] pytorch                   2.0.0.dev20221210     py3.9_cpu_0    pytorch-nightly<br>
[conda] pytorch-cuda              11.7                 h67b0de4_1    pytorch-nightly<br>
[conda] pytorch-mutex             1.0                         cpu    pytorch-nightly<br>
[conda] torchaudio                0.14.0.dev20221212        py39_cpu    pytorch-nightly<br>
[conda] torchvision               0.15.0.dev20221212        py39_cpu    pytorch-nightly</p>

username: EricF
cooked: <p>Problem seems to be solved<br>
I reinstall nvidia drivers with ubuntu package manager ( in parameters) nvidia-driver-525<br>
Then reinstall anaconda and pytorch with conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch-nightly -c nvidia</p>
<p>and bingo<br>
torch.cuda.is_available()<br>
Out[2]: True</p>
<p>Thanks for your help</p>