Pytorch 1.5.0 Version Problems

chiehpower: <p>Hi all,</p>
<p>I wonder whether Pytorch 1.5.0 can suppport CUDA 10.0 version?<br>
Because I install by particular version, it cannot find it.</p>
<pre><code class="lang-auto">$ sudo -H python3 -m pip install torch==1.5.0+cu100 torchvision==0.6.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html

Looking in links: https://download.pytorch.org/whl/torch_stable.html
ERROR: Could not find a version that satisfies the requirement torch==1.5.0+cu100 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.3.0.post4, 0.3.1, 0.4.0, 0.4.1, 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0, 1.2.0+cpu, 1.2.0+cu92, 1.3.0, 1.3.0+cpu, 1.3.0+cu100, 1.3.0+cu92, 1.3.1, 1.3.1+cpu, 1.3.1+cu100, 1.3.1+cu92, 1.4.0, 1.4.0+cpu, 1.4.0+cu100, 1.4.0+cu92, 1.5.0, 1.5.0+cpu, 1.5.0+cu101, 1.5.0+cu92)
ERROR: No matching distribution found for torch==1.5.0+cu100
</code></pre>
<p>Thank you.</p>

ptrblck: <p>CUDA9.2, 10.1 and 10.2 are supported as given in the installation instruction on the <a href="https://pytorch.org/get-started/locally/">Get Started section</a>.</p>

chiehpower: <p>Hi <a class="mention" href="/u/ptrblck">@ptrblck</a>,</p>
<p>I knew. However, my CUDA version is 10.0 and I used this command below to install.</p>
<pre><code class="lang-auto">pip3 install torch==1.5.0 torchvision==0.6.0
</code></pre>
<p>And then I checked by this codes:</p>
<pre><code class="lang-auto">Python 3.6.9 (default, Apr 18 2020, 01:56:04) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; from __future__ import print_function
&gt;&gt;&gt; import torch
&gt;&gt;&gt; x = torch.rand(5, 3)
&gt;&gt;&gt; print(x)
tensor([[0.8461, 0.7381, 0.3203],
        [0.1165, 0.6319, 0.7956],
        [0.6238, 0.5151, 0.5223],
        [0.5648, 0.0722, 0.0100],
        [0.1062, 0.3086, 0.0313]])
&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.cuda.is_available()
True
</code></pre>
<p>Although it worked, I was building the <a href="https://github.com/facebookresearch/detectron2/blob/master/INSTALL.md" rel="nofollow noopener">detectron2 repository</a> and I got the error.</p>
<pre><code class="lang-auto">    Traceback (most recent call last):
      File "/usr/local/bin/ninja", line 11, in &lt;module&gt;
        load_entry_point('ninja==1.9.0.post1', 'console_scripts', 'ninja')()
      File "/usr/local/lib/python3.6/dist-packages/ninja-1.9.0.post1-py3.6-linux-x86_64.egg/ninja/__init__.py", line 50, in ninja
        raise SystemExit(_program('ninja', sys.argv[1:]))
      File "/usr/local/lib/python3.6/dist-packages/ninja-1.9.0.post1-py3.6-linux-x86_64.egg/ninja/__init__.py", line 46, in _program
        return subprocess.call([os.path.join(BIN_DIR, name)] + args)
      File "/usr/lib/python3.6/subprocess.py", line 287, in call
        with Popen(*popenargs, **kwargs) as p:
      File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
        restore_signals, start_new_session)
      File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/ninja-1.9.0.post1-py3.6-linux-x86_64.egg/ninja/data/bin/ninja'
    Traceback (most recent call last):
      File "&lt;string&gt;", line 1, in &lt;module&gt;
      File "/home/chieh/github/detectron2/setup.py", line 149, in &lt;module&gt;
        cmdclass={"build_ext": torch.utils.cpp_extension.BuildExtension},
      File "/home/chieh/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/chieh/.local/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 296, in run
        self.find_sources()
      File "/home/chieh/.local/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
        mm.run()
      File "/home/chieh/.local/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 534, in run
        self.add_defaults()
      File "/home/chieh/.local/lib/python3.6/site-packages/setuptools/command/egg_info.py", line 570, in add_defaults
        sdist.add_defaults(self)
      File "/home/chieh/.local/lib/python3.6/site-packages/setuptools/command/py36compat.py", line 36, in add_defaults
        self._add_defaults_ext()
      File "/home/chieh/.local/lib/python3.6/site-packages/setuptools/command/py36compat.py", line 119, in _add_defaults_ext
        build_ext = self.get_finalized_command('build_ext')
      File "/usr/lib/python3.6/distutils/cmd.py", line 298, in get_finalized_command
        cmd_obj = self.distribution.get_command_obj(command, create)
      File "/usr/lib/python3.6/distutils/dist.py", line 847, in get_command_obj
        cmd_obj = self.command_obj[command] = klass(self)
      File "/home/chieh/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 303, in __init__
        elif not _is_ninja_available():
      File "/home/chieh/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1192, in _is_ninja_available
        subprocess.check_call('ninja --version'.split(), stdout=devnull)
      File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['ninja', '--version']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
</code></pre>
<p>It can successfully build on other low pytorch version.(i.e., Pytorch v1.4.0 or v1.3.1)<br>
So I was confused whether it is the problem of pytorch version with CUDA version or not.</p>

ptrblck: <p>The error points to a <code>PermissionError</code> and I’m unsure, what might cause it.</p>
<p>However, if you building the extension with CUDA extensions, you should update your local CUDA installation to match the CUDA shipped in the PyTorch binaries.</p>
<p>Note, that apparently CUDA10.1 <a href="https://github.com/facebookresearch/detectron2/blob/master/INSTALL.md#install-pre-built-detectron2">binaries</a> for Detectron2 are available.</p>

chiehpower: <p>I will consider to install other cuda version.<br>
Thanks for your suggestion!</p>
<p>(I tested again by <code>sudo</code> that I got the same error.)</p>