Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to downgrade to cuda 10.0 in arch linux?

I want to downgrade my cuda 10.1 to cuda 10.0 in arch linux as tensorflow requires cuda 10.0 only.

I installed tensorflow on CUDA 10.1 in arch Linux but I didn't know tensorflow-gpu needs CUDA 10.0 or lesser.

I tried tried symlinking the required 10.0 libraries with new 10.1 libraries but it didn't work.

Whenever I try to import tensorflow in python console error shows up that 'libcublas.so.10.0' not found.

So I found out that I can only run tensorflow on CUDA 10.0 so now I want to downgrade my CUDA. But I have no Idea how to do that in arch Linux.

Every time I run import tensorflow it gives this error.

Traceback (most recent call last):
  File "/home/techievin/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/techievin/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/techievin/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.7/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.7/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /usr/lib/libcublas.so.10.0: version `libcublas.so.10.0' not found (required by /home/techievin/.local/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/techievin/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/home/techievin/.local/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/techievin/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/techievin/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/techievin/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/techievin/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.7/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.7/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /usr/lib/libcublas.so.10.0: version `libcublas.so.10.0' not found (required by /home/techievin/.local/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)


Failed to load the native TensorFlow runtime.

pacman -S cuda=="10.0" is not working.

I searched everywhere but couldn't find any proper answer for arch Linux to downgrade to CUDA 10.0

like image 963
TechieViN Avatar asked Feb 04 '23 18:02

TechieViN


2 Answers

  1. Download cuda 10.0 package from here: http://archlinux.arkena.net/archive/packages/c/cuda/cuda-10.0.130-2-x86_64.pkg.tar.xz
  2. Install package sudo pacman -U cuda-10.0.130-2-x86_64.pkg.tar.xz
like image 158
Jimmy Tran Avatar answered Feb 06 '23 07:02

Jimmy Tran


I've solved this issue by using yay. With yay you can install older versions of cuda and cudnn. In my experience this is faster than downloading from archive.org.

Install yay on Arch:

pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Search for the version you need:

yay -Ss cuda
yay -Ss cudnn

At the moment of writing this answer I needed to downgrade from cuda 11.2 to 11.0. So I installed specific versions:

pacman -R cuda cudnn
yay -S cuda-11.0 cudnn8-cuda11.0

For me, Tensorflow worked smoothly after downgrading.

like image 21
thijsai Avatar answered Feb 06 '23 08:02

thijsai