Torch.cuda.is_available() return False

bbsyip: <p>version:<br>
nvidia-smi: NVIDIA-SMI 450.51.05    Driver Version: 450.51.05    CUDA Version: 11.0<br>
nvcc -V:Cuda compilation tools, release 11.0, V11.0.194. Build cuda_11.0_bu.TC445_37.28540450_0<br>
torch:1.7.1+cu110<br>
torchaudio                0.7.2                      py37    pytorch<br>
torchaudio                0.7.2                     <br>
torchmetrics              0.9.3                     <br>
torchvision               0.8.2+cu110               <br>
torchvision               0.8.2                py37_cu102    pytorch<br>
conda env.<br>
torch.cuda.is_available() return False</p>

bbsyip: <p>!python -m torch.utils.collect_env</p>
<p>Collecting environment information…<br>
/datasdc_3421/asr/ubuntu20.04/espnet/tools/anaconda/envs/yi/lib/python3.7/site-packages/torch/cuda/<strong>init</strong>.py:52: UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:100.)<br>
return torch._C._cuda_getDeviceCount() &gt; 0<br>
PyTorch version: 1.7.1+cu110<br>
Is debug build: False<br>
CUDA used to build PyTorch: 11.0<br>
ROCM used to build PyTorch: N/A</p>
<p>OS: Ubuntu 16.04.7 LTS (x86_64)<br>
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609<br>
Clang version: Could not collect<br>
CMake version: version 3.20.5</p>
<p>Python version: 3.7 (64-bit runtime)<br>
Is CUDA available: False<br>
CUDA runtime version: Could not collect<br>
GPU models and configuration:<br>
GPU 0: Tesla P40<br>
GPU 1: Tesla P40</p>
<p>Nvidia driver version: 450.51.05<br>
cuDNN version: Probably one of the following:<br>
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.3<br>
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.2.4<br>
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.2.4<br>
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.2.4<br>
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.2.4<br>
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.2.4<br>
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.2.4<br>
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.2.4<br>
/usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn.so.8<br>
HIP runtime version: N/A<br>
MIOpen runtime version: N/A</p>
<p>Versions of relevant libraries:<br>
[pip3] numpy==1.19.2<br>
[pip3] pytorch-lightning==1.1.2<br>
[pip3] torch==1.7.1+cu110<br>
[pip3] torchaudio==0.7.2<br>
[pip3] torchmetrics==0.9.3<br>
[pip3] torchvision==0.8.2+cu110<br>
[conda] blas                      1.0                         mkl<br>
[conda] cudatoolkit               10.2.89              hfd86e86_1<br>
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch<br>
[conda] mkl                       2020.2                      256<br>
[conda] mkl-service               2.3.0            py37he8ac12f_0<br>
[conda] mkl_fft                   1.3.0            py37h54f3939_0<br>
[conda] mkl_random                1.1.1            py37h0573a6f_0<br>
[conda] numpy                     1.19.2           py37h54aff64_0<br>
[conda] numpy-base                1.19.2           py37hfa32c7d_0<br>
[conda] pytorch                   1.7.1           py3.7_cuda10.2.89_cudnn7.6.5_0    pytorch<br>
[conda] pytorch-lightning         1.1.2                     <br>
[conda] pytorch-mutex             1.0                        cuda    pytorch<br>
[conda] torch                     1.7.1+cu110               <br>
[conda] torchaudio                0.7.2                      py37    pytorch<br>
[conda] torchaudio                0.7.2                     <br>
[conda] torchmetrics              0.9.3                     <br>
[conda] torchvision               0.8.2+cu110               <br>
[conda] torchvision               0.8.2                py37_cu102    pytorch</p>

bbsyip: <p>I have result this problem,see <a href="https://blog.csdn.net/qq_40992227/article/details/123305773" rel="noopener nofollow ugc">(188条消息) UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up env_qq_409992227的博客-CSDN博客</a>.</p>
<p>apt-get install nvidia-modprobe<br>
then torch.cuda.is_available() return True</p>