Installing Pytorch CUDA on Manjaro

username: barradas
cooked: <p>Hi!<br>
I’m failing to install pytorch with cuda support on a clean Manjaro install. (Lysia, 20.0.3: kernel is 5.6.15-1-MANJARO)<br>
The GPU is a GTX1080ti, CUDA is 10.2.89, and I have tried two ways of installing torch. The first was, as the documentation specifies: <code>pip install --user torch torchvision</code>. I got this through selecting [Stable, linux, pip, python, cuda 10.2] on the “getting started” guide. I included the <code>--user</code> flag, since installing python packages as root is discouraged on the Archwiki.</p>
<p>The other method I tried was with pacman, installing the <code>python-pytorch-cuda</code> package.<br>
On both cases, the result of the <code>torch.cuda.is_available()</code> function call is False.</p>
<p>I’ve installed cuda-10.2.89-5 through pacman, with the opencl nvidia-340xx drivers. Could this be a problem?<br>
I’ve read <a href="https://discuss.pytorch.org/t/recommended-linux-distro/13367">this post</a> saying that any distro is fine for pytorch, and the “Getting started” guide lists Arch as the first linux on the list to use pytorch.</p>
<p>I have found no information concerning this problem at all, that’s why I’m writing here. The fact that I haven’t found any post on this makes me think that my setup is wrong, and this is not a bug, but I don’t know where else to look. Would anyone happen to have a solution to this? or maybe a suggestion into what I should be looking at?<br>
<code>nvtop</code> shows the gpu working well.<br>
Here’s the output of <code>nvcc --version</code>:</p>
<pre><code class="lang-auto">nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:24:38_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89
</code></pre>
<p>This is the output of <code>torch.cuda.current_device()</code></p>
<pre><code class="lang-auto">AssertionError: 
The NVIDIA driver on your system is too old (found version 10010).
Please update your GPU driver by downloading and installing a new
version from the URL: http://www.nvidia.com/Download/index.aspx
Alternatively, go to: https://pytorch.org to install
a PyTorch version that has been compiled with your version
of the CUDA driver.
</code></pre>
<p>This error was <a href="https://github.com/pytorch/pytorch/issues/4546" rel="nofollow noopener">reported for cuda 9.0</a>, but it was closed, and I’m using 10.2.</p>
<p>Thanks!</p>

username: ptrblck
cooked: <p>For CUDA10.2.89, you would need a driver &gt;=440.33 as given in <a href="https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility__table-toolkit-driver">this table</a>.<br>
Could you try to update the driver and reinstall PyTorch?</p>

username: barradas
cooked: <p>It worked! I had to uninstall all video drivers, cuda-dependent packages, and reinstall the video-nvidia-440xx package. I did so with Manjaro’s auto-install tool: <a href="https://wiki.manjaro.org/index.php?title=Manjaro_Settings_Manager#Hardware_Detection" rel="nofollow noopener">https://wiki.manjaro.org/index.php?title=Manjaro_Settings_Manager#Hardware_Detection</a></p>
<p>I think the problem was installing the <a href="https://www.archlinux.org/packages/?name=opencl-nvidia" rel="nofollow noopener">opencl-nvidia</a> package. This installs the 430xx nvidia drivers by default. I don’t remember when I did this, but it had to do with nvidia-docker, for one of my last projects.</p>
<p>Thanks for the tip!</p>