Install pytorch 1.9.0 with unexpected problem

hitbuyi: <p>I follow the official guide to install pytorch 1.9.0 + cuda11.3</p>
<p>conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cudatoolkit=11.3 -c pytorch -c conda-forge</p>
<p>after installment  finished, it seems cpu version is installed,not GPU</p>
<p>(py190) hitbuyi@hitbuyi-Dell-G15-5511:~/tmp/$ conda list<br>
packages in environment at /home/hitbuyi/.conda/envs/py190:<br>
Name                    Version                   Build  Channel</p>
<p>cpuonly                   1.0                           0    pytorch<br>
cudatoolkit               11.3.1               h2bc3f7f_2<br>
imagesize                 1.4.1                    pypi_0    pypi<br>
importlib-metadata        4.12.0                   pypi_0    pypi<br>
imutils                   0.5.4                    pypi_0    pypi<br>
intel-openmp              2022.0.1          h06a4308_3633<br>
joblib                    1.1.0                    pypi_0    pypi<br>
jpeg                      9b                   h024ee3a_2<br>
kiwisolver                1.4.2                    pypi_0    pypi<br>
lame                      3.100             h7f98852_1001    conda-forge<br>
ld_impl_linux-64          2.35.1               h7274673_9<br>
libffi                    3.3                  he6710b0_2<br>
libgcc-ng                 9.3.0               h5101ec6_17<br>
libgomp                   9.3.0               h5101ec6_17<br>
libiconv                  1.16                 h516909a_0    conda-forge<br>
libpng                    1.6.37               h21135ba_2    conda-forge<br>
libstdcxx-ng              9.3.0               hd4cf53a_17<br>
libtiff                   4.1.0                h2733197_1<br>
libuv                     1.42.0               h7f98852_0    conda-forge<br>
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge<br>
markdown                  3.4.1                    pypi_0    pypi<br>
markupsafe                2.1.1                    pypi_0    pypi<br>
matplotlib                3.5.1                    pypi_0    pypi<br>
mkl                       2020.2                      256<br>
mkl-service               2.3.0            py38h1e0a361_2    conda-forge<br>
mkl_fft                   1.2.0            py38hab2c0dc_1    conda-forge<br>
mkl_random                1.2.0            py38hc5bc63f_1    conda-forge<br>
mpmath                    1.2.1                    pypi_0    pypi<br>
ncurses                   6.3                  h7f8727e_2<br>
nettle                    3.6                  he412f7d_0    conda-forge<br>
ninja                     1.10.2               h4bd325d_0    conda-forge<br>
numpy                     1.22.3                   pypi_0    pypi<br>
numpy-base                1.19.2           py38hfa32c7d_0<br>
nvidia-dali-cuda110       1.16.0                   pypi_0    pypi<br>
oauthlib                  3.2.0                    pypi_0    pypi<br>
olefile                   0.46               pyh9f0ad1d_1    conda-forge<br>
onnx                      1.11.0                   pypi_0    pypi<br>
onnx-simplifier           0.3.7                    pypi_0    pypi<br>
onnxoptimizer             0.2.6                    pypi_0    pypi<br>
onnxruntime               1.11.0                   pypi_0    pypi<br>
opencv-contrib-python     4.5.5.64                 pypi_0    pypi<br>
opencv-python             4.6.0.66                 pypi_0    pypi<br>
openh264                  2.1.1                h780b84a_0    conda-forge<br>
openssl                   1.1.1q               h7f8727e_0<br>
packaging                 21.3                     pypi_0    pypi<br>
pandas                    1.4.1                    pypi_0    pypi<br>
pathspec                  0.9.0                    pypi_0    pypi<br>
pillow                    9.0.1                    pypi_0    pypi<br>
pip                       21.2.4           py38h06a4308_0<br>
python                    3.8.12               h12debd9_0<br>
python-dateutil           2.8.2                    pypi_0    pypi<br>
python_abi                3.8                      2_cp38    conda-forge<br>
pytorch                   1.9.0               py3.8_cpu_0  [cpuonly]  pytorch<br>
pytz                      2022.1                   pypi_0    pypi<br>
pyyaml                    6.0                      pypi_0    pypi<br>
readline                  8.1.2                h7f8727e_1<br>
requests                  2.27.1                   pypi_0    pypi<br>
requests-oauthlib         1.3.1                    pypi_0    pypi<br>
rsa                       4.9                      pypi_0    pypi<br>
scikit-learn              1.1.1                    pypi_0    pypi<br>
scipy                     1.8.0                    pypi_0    pypi<br>
seaborn                   0.11.2                   pypi_0    pypi<br>
setuptools                58.0.4           py38h06a4308_0<br>
six                       1.16.0             pyh6c4a22f_0    conda-forge<br>
sklearn                   0.0                      pypi_0    pypi<br>
sqlite                    3.38.0               hc218d9a_0<br>
sympy                     1.10.1                   pypi_0    pypi<br>
tensorboard               2.9.1                    pypi_0    pypi<br>
tensorboard-data-server   0.6.1                    pypi_0    pypi<br>
tensorboard-plugin-wit    1.8.1                    pypi_0    pypi<br>
threadpoolctl             3.1.0                    pypi_0    pypi<br>
tk                        8.6.11               h1ccaba5_0<br>
torchaudio                0.9.0                    pypi_0    pypi<br>
torchstat                 0.0.7                    pypi_0    pypi<br>
torchvision               0.10.0                 py38_cpu  [cpuonly]  pytorch<br>
tqdm                      4.64.0                   pypi_0    pypi<br>
typing-extensions         4.1.1                    pypi_0    pypi<br>
typing_extensions         4.3.0              pyha770c72_0    conda-forge<br>
ujson                     5.4.0                    pypi_0    pypi<br>
urllib3                   1.26.9                   pypi_0    pypi<br>
werkzeug                  2.2.1                    pypi_0    pypi<br>
wheel                     0.37.1             pyhd3eb1b0_0<br>
xz                        5.2.5                h7b6447c_0<br>
zipp                      3.8.1                    pypi_0    pypi<br>
zlib                      1.2.11               h7f8727e_4<br>
zstd                      1.4.9                ha95c52a_0    conda-forge</p>
<p>(py190) hitbuyi@hitbuyi-Dell-G15-5511:~/WorkInDD/Deploy/nVidia/DALI$ python<br>
Python 3.8.12 (default, Oct 12 2021, 13:49:34)<br>
[GCC 7.5.0] :: Anaconda, Inc. on linux<br>
Type “help”, “copyright”, “credits” or “license” for more information.</p>
<blockquote>
<blockquote>
<blockquote>
<p>import torch<br>
import torch<br>
print(torch.is_cuda_available())<br>
Traceback (most recent call last):<br>
File “”, line 1, in <br>
AttributeError: module ‘torch’ has no attribute ‘is_cuda_available’</p>
</blockquote>
</blockquote>
</blockquote>
<p>According to output of conda list<br>
1, what is cpuonly?<br>
2, the following<br>
pytorch                   1.9.0               py3.8_cpu_0  [cpuonly]  pytorch</p>
<p>means that  pytorch 1.9.0  cpu version is installed, not GPU version, why?</p>
<p>any help is appreciated .</p>

ptrblck: <p>Yes, it seems the CPU-only binary was installed. The install log should show which package was found and might give you more information why the binary with the CUDA runtime wasn’t installed.<br>
PS: I would also recommend to install the latest binary (<code>1.12.0</code>) instead of an older one for the latest fixes and features.</p>

hitbuyi: <p>I found  on site <a href="https://download.pytorch.org/whl/torch_stable.html" rel="noopener nofollow ugc">https://download.pytorch.org/whl/torch_stable.html</a>, pytorch 1.9.0 has no stable version connecting to cuda11.3, so pytorch 1.9.0 + cuda11.3 is not good choice, right?</p>
<p>in my local computer,  I installed a cuda version of 11.3 in ubutnu environment, when I run offical command<br>
conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cudatoolkit=11.3 -c pytorch -c conda-forge</p>
<p>it detects my local cuda  of version  v11.3, and is forced to change to cpu version? is this possible ? if so, I think it isn’t to a good strategy, since local cuda is independent to cuda in conda’s virtual environment, more than one versions of cuda exist in my computer.<br>
1 ubuntu:  cuda 11.3<br>
2  conda:   1) tensorflow + cuda 10.2   2)pytorch1.9.0 + cuda11.1(I want to change it to pytorch1.9.0 + cuda11.3)</p>
<p>I use pytorch 1.10, which is in list of <a href="https://download.pytorch.org/whl/torch_stable.html" rel="noopener nofollow ugc">https://download.pytorch.org/whl/torch_stable.html</a>,  and installment of gpu version is successful.</p>

ptrblck: <p>Yes, this could indeed be the case and I don’t remember which PyTorch binary release shipped with the CUDA 11.3 runtime. Note that your local CUDA toolkit won’t be used unless you build PyTorch from source or a custom CUDA extension.<br>
Good to hear it’s working now!</p>