Import torch fails with fresh conda installation

My OS is Ubuntu 22.04

I only install anaconda from Anaconda3-2022.10-Linux-x86_64.sh
And then run conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia

import torch gives
File “/home/fenaux/anaconda3/lib/python3.9/site-packages/torch/init.py”, line 191, in
_load_global_deps()

File “/home/fenaux/anaconda3/lib/python3.9/site-packages/torch/init.py”, line 153, in _load_global_deps
ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)

File “/home/fenaux/anaconda3/lib/python3.9/ctypes/init.py”, line 382, in init
self._handle = _dlopen(self._name, mode)

OSError: libcufft.so.10: cannot open shared object file: No such file or directory

when I check in anaconda3/lib I only find libcufft.so.11
I also tried with
conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
an d result is exactly the same
I have no other environment and no other installation of pytorch

Thanks for helping me

I made a new installation
After anaconda installation I ran
conda install -c "nvidia/label/cuda-11.7.1" cuda-toolkit
and notice that the associated package include libcufft-10.7.2.91
then conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia

import torch

torch.version.cuda
Out[4]: ‘11.7’

torch.backends.cudnn.enabled
Out[5]: True

but …
torch.cuda.is_available()
Out[2]: False

And I still have the problem after rebooting my computer

This should be fixed via this PR so you could use the current nightly or re-download the package.

Thanks for your answer
I reinstalled anaconda as before and the directly

conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch-nightly -c nvidia

then import torch is ok :+1:
but I still have the problem with cuda
torch.cuda.is_available()
Out[3]: False

torch.backends.cudnn.enabled
Out[2]: True

system knows the GPU

lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3080 Mobile / Max-Q 8GB/16GB] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GA104 High Definition Audio Controller (rev a1)

but
nvidia-smi
commande « nvidia-smi » not found but maybe installed with :
sudo apt install nvidia-utils-390 # version 390.157-0ubuntu0.22.04.1, or
sudo apt install nvidia-utils-450-server # version 450.216.04-0ubuntu0.22.04.1
sudo apt install nvidia-utils-470 # version 470.161.03-0ubuntu0.22.04.1
sudo apt install nvidia-utils-470-server # version 470.161.03-0ubuntu0.22.04.1
sudo apt install nvidia-utils-510 # version 510.108.03-0ubuntu0.22.04.1
sudo apt install nvidia-utils-515 # version 515.86.01-0ubuntu0.22.04.1
sudo apt install nvidia-utils-515-server # version 515.86.01-0ubuntu0.22.04.1
sudo apt install nvidia-utils-525 # version 525.60.11-0ubuntu0.22.04.1
sudo apt install nvidia-utils-418-server # version 418.226.00-0ubuntu4
sudo apt install nvidia-utils-510-server # version 510.47.03-0ubuntu3

restart my computer doesn’t change anything

I do not know if that help, some additionnal informations
$ python -m torch.utils.collect_env
Collecting environment information…
PyTorch version: 2.0.0.dev20221210
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.1 LTS (x86_64)
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35

Python version: 3.9.13 (main, Aug 25 2022, 23:26:10) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: 11.7.99
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.5
[pip3] numpydoc==1.4.0
[pip3] torch==2.0.0.dev20221210
[pip3] torchaudio==0.14.0.dev20221212
[pip3] torchvision==0.15.0.dev20221212
[conda] blas 1.0 mkl
[conda] mkl 2021.4.0 h06a4308_640
[conda] mkl-service 2.4.0 py39h7f8727e_0
[conda] mkl_fft 1.3.1 py39hd3c417c_0
[conda] mkl_random 1.2.2 py39h51133e4_0
[conda] numpy 1.21.5 py39h6c91a56_3
[conda] numpy-base 1.21.5 py39ha15fc14_3
[conda] numpydoc 1.4.0 py39h06a4308_0
[conda] pytorch 2.0.0.dev20221210 py3.9_cpu_0 pytorch-nightly
[conda] pytorch-cuda 11.7 h67b0de4_1 pytorch-nightly
[conda] pytorch-mutex 1.0 cpu pytorch-nightly
[conda] torchaudio 0.14.0.dev20221212 py39_cpu pytorch-nightly
[conda] torchvision 0.15.0.dev20221212 py39_cpu pytorch-nightly

Problem seems to be solved
I reinstall nvidia drivers with ubuntu package manager ( in parameters) nvidia-driver-525
Then reinstall anaconda and pytorch with conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch-nightly -c nvidia

and bingo
torch.cuda.is_available()
Out[2]: True

Thanks for your help