Pytorch for cuda 10.2

GeForce GTX TITAN ,Driver Version: 440.59,CUDA Version: 10.2
Earlier CUDA Version was 10.1 and was working fine with the following pytorch intallation command

conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch

Now with the following command , I installed pytorch.

conda install pytorch==1.5.0 torchvision==0.6.0 cudatoolkit=10.2 -c pytorch

But when I try to train my model get the following error
RuntimeError: CUDA error: no kernel image is available for execution on the device
Then I saw your repository https://github.com/pytorch/pytorch#from-source , to build from source . But I am getting the following error, when i run python setup.py
Building wheel torch-1.7.0a0
– Building version 1.7.0a0
cmake --build . --target install --config Release – -j 8
No such file or directory
CMake Error: Generator: execution of make failed. Make command was: “/home/remya/anaconda3/bin/ninja” “-j” “8” “install”
Traceback (most recent call last):
File “setup.py”, line 727, in
build_deps()
File “setup.py”, line 319, in build_deps
cmake=cmake)
File “/home/remya/pytorch/tools/build_pytorch_libs.py”, line 62, in build_caffe2
cmake.build(my_env)
File “/home/remya/pytorch/tools/setup_helpers/cmake.py”, line 346, in build
self.run(build_args, my_env)
File “/home/remya/pytorch/tools/setup_helpers/cmake.py”, line 141, in run
check_call(command, cwd=self.build_dir, env=env)
File “/home/remya/anaconda3/lib/python3.7/subprocess.py”, line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘–build’, ‘.’, ‘–target’, ‘install’, ‘–config’, ‘Release’, ‘–’, ‘-j’, ‘8’]’ returned non-zero exit status 1.

The GeForce GTX Titan has a compute capability of 3.5, which is not shipped anymore in the binaries, so you would indeed need to build from source.

Could you post the complete install log here, please?

Note that you can post code snippets by wrapping them into three backticks ```. :wink:

I tried the following installation

conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch

Now my model is training on cuda. Let me see if it will be adequate for the current work .

Thanks
Remya

Hi,

conda uninstall cpuonly does not work, do I have to use any other command to not install CPU version of PyTorch and install Cuda version

I went through these discussions and other resources as well, but I could not seem to get PyTorch to use GPU. Whenever I run this command -
python -c 'import torch;print(torch.cuda.is_available())'
the output would be false

Following are the steps I followed -

  1. Installed CUDA toolkit 10.2 ,
  2. Downloaded CuDNN v8.0.5 and copied its file to the CUDA toolkit 10.2 folder
  3. Installed 10.1 torch version in conda env –
    conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
  4. I have NVIDIA GeForce 940MX GPU and I am using a windows OS

This is the installation log of the command -
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch



## Package Plan ##

  added / updated specs:
    - cudatoolkit=10.1
    - pytorch
    - torchvision


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    brotlipy-0.7.0             |py37h2bbff1b_1003         337 KB
    cffi-1.15.1                |   py37h2bbff1b_3         236 KB
    cryptography-38.0.4        |   py37h21b164f_0         1.0 MB
    idna-3.4                   |   py37haa95532_0          92 KB
    mkl-service-2.4.0          |   py37h2bbff1b_0          49 KB
    mkl_fft-1.3.1              |   py37h277e83a_0         135 KB
    mkl_random-1.2.2           |   py37hf11a4ad_0         216 KB
    numpy-1.21.5               |   py37h7a0a035_3          25 KB
    numpy-base-1.21.5          |   py37hca35cd5_3         4.4 MB
    pillow-9.3.0               |   py37hdc2b20a_1        1009 KB
    pysocks-1.7.1              |           py37_1          28 KB
    pytorch-1.13.1             |      py3.7_cpu_0       135.5 MB  pytorch
    requests-2.28.1            |   py37haa95532_0          99 KB
    torchvision-0.14.1         |         py37_cpu         6.3 MB  pytorch
    typing_extensions-4.4.0    |   py37haa95532_0          46 KB
    urllib3-1.26.14            |   py37haa95532_0         192 KB
    win_inet_pton-1.1.0        |   py37haa95532_0          35 KB
    ------------------------------------------------------------
                                           Total:       149.6 MB

The following NEW packages will be INSTALLED:

  blas               pkgs/main/win-64::blas-1.0-mkl
  brotlipy           pkgs/main/win-64::brotlipy-0.7.0-py37h2bbff1b_1003
  cffi               pkgs/main/win-64::cffi-1.15.1-py37h2bbff1b_3
  charset-normalizer pkgs/main/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0
  cryptography       pkgs/main/win-64::cryptography-38.0.4-py37h21b164f_0
  cudatoolkit        pkgs/main/win-64::cudatoolkit-10.1.243-h74a9793_0
  flit-core          pkgs/main/noarch::flit-core-3.6.0-pyhd3eb1b0_0
  freetype           pkgs/main/win-64::freetype-2.12.1-ha860e81_0
  idna               pkgs/main/win-64::idna-3.4-py37haa95532_0
  intel-openmp       pkgs/main/win-64::intel-openmp-2021.4.0-haa95532_3556
  jpeg               pkgs/main/win-64::jpeg-9e-h2bbff1b_0
  lerc               pkgs/main/win-64::lerc-3.0-hd77b12b_0
  libdeflate         pkgs/main/win-64::libdeflate-1.8-h2bbff1b_5
  libpng             pkgs/main/win-64::libpng-1.6.37-h2a8f88b_0
  libtiff            pkgs/main/win-64::libtiff-4.5.0-h8a3f274_0
  libuv              pkgs/main/win-64::libuv-1.40.0-he774522_0
  libwebp            pkgs/main/win-64::libwebp-1.2.4-h2bbff1b_0
  libwebp-base       pkgs/main/win-64::libwebp-base-1.2.4-h2bbff1b_0
  lz4-c              pkgs/main/win-64::lz4-c-1.9.4-h2bbff1b_0
  mkl                pkgs/main/win-64::mkl-2021.4.0-haa95532_640
  mkl-service        pkgs/main/win-64::mkl-service-2.4.0-py37h2bbff1b_0
  mkl_fft            pkgs/main/win-64::mkl_fft-1.3.1-py37h277e83a_0
  mkl_random         pkgs/main/win-64::mkl_random-1.2.2-py37hf11a4ad_0
  numpy              pkgs/main/win-64::numpy-1.21.5-py37h7a0a035_3
  numpy-base         pkgs/main/win-64::numpy-base-1.21.5-py37hca35cd5_3
  pillow             pkgs/main/win-64::pillow-9.3.0-py37hdc2b20a_1
  pycparser          pkgs/main/noarch::pycparser-2.21-pyhd3eb1b0_0
  pyopenssl          pkgs/main/noarch::pyopenssl-22.0.0-pyhd3eb1b0_0
  pysocks            pkgs/main/win-64::pysocks-1.7.1-py37_1
  pytorch            pytorch/win-64::pytorch-1.13.1-py3.7_cpu_0
  pytorch-mutex      pytorch/noarch::pytorch-mutex-1.0-cpu
  requests           pkgs/main/win-64::requests-2.28.1-py37haa95532_0
  six                pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_1
  tk                 pkgs/main/win-64::tk-8.6.12-h2bbff1b_0
  torchvision        pytorch/win-64::torchvision-0.14.1-py37_cpu
  typing_extensions  pkgs/main/win-64::typing_extensions-4.4.0-py37haa95532_0
  urllib3            pkgs/main/win-64::urllib3-1.26.14-py37haa95532_0
  win_inet_pton      pkgs/main/win-64::win_inet_pton-1.1.0-py37haa95532_0
  xz                 pkgs/main/win-64::xz-5.2.10-h8cc25b3_1
  zlib               pkgs/main/win-64::zlib-1.2.13-h8cc25b3_0
  zstd               pkgs/main/win-64::zstd-1.5.2-h19a0ad4_0