Tensorflow ERROR: CUDA driver version is insufficient for CUDA runtime version

I recently installed Manjaro Awesome 18.1.3. After installing it, i performed a pacman -Syu . After that I installed tensorflow using pacman -S python-tensorflow-cuda. I run every python script in this way: sudo optirun python script.py.

However, after running tf.test.is_gpu_available() , I get the following error:

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    gpu_avail = tf.test.is_gpu_available()
  File "/usr/lib/python3.8/site-packages/tensorflow_core/python/util/deprecation.py", line 324, in new_func
    return func(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/tensorflow_core/python/framework/test_util.py", line 1513, in is_gpu_available
    for local_device in device_lib.list_local_devices():
  File "/usr/lib/python3.8/site-packages/tensorflow_core/python/client/device_lib.py", line 43, in list_local_devices
    _convert(s) for s in _pywrap_device_lib.list_devices(serialized_config)
RuntimeError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version

Installed Packages:

community/cuda 10.2.89-3 [installed]
community/cudnn 7.6.5.32-3 [installed]
community/pycuda-headers 2019.1.2-5 [installed]
community/python-pycuda 2019.1.2-5 [installed]
community/python-tensorflow-cuda 2.1.0-3 [installed]
community/tensorflow-cuda 2.1.0-3 [installed]
core/mhwd-nvidia-340xx 340.108-1 [installed]
core/mhwd-nvidia-390xx 390.132-1 [installed]
core/mhwd-nvidia-418xx 418.113-1 [installed]
core/mhwd-nvidia-430xx 430.64-1.0 [installed]
core/mhwd-nvidia-435xx 435.21-1.0 [installed]
core/mhwd-nvidia-440xx 440.64-1 [installed]
extra/libvdpau 1.3-1 [installed]
extra/linux55-nvidia-418xx 418.113-10 (linux55-extramodules) [installed]
extra/nvidia-418xx-utils 418.113-2 [installed]
extra/opencl-nvidia-340xx 340.108-1 [installed]
community/bumblebee 3.2.1-22 [installed]
community/linux-latest-nvidia-418xx 5.5-1 (linux-latest-extramodules) [installed]
community/nccl 2.5.7-4 [installed]
community/pycuda-headers 2019.1.2-5 [installed]
community/python-pycuda 2019.1.2-5 [installed]
multilib/lib32-libvdpau 1.3-1 [installed]
multilib/lib32-nvidia-418xx-utils 418.113-1 [installed]
    Query information about the installed Nvidia GPUs.
aur/opencl-nvidia-340xx 340.108-1 (11, 1.08301) [installed: 340.108-1]

Nvidia-smi output:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.113      Driver Version: 418.113      CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce MX150       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   40C    P0    N/A /  N/A |      6MiB /  2002MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0     19339      G   /usr/lib/Xorg                                  5MiB |
+-----------------------------------------------------------------------------+

Im not an expert but I have tensorflow running and I have an mx150 too.

I installed manjaro 19 with the non-free driver option, it installed the 440 nvidia driver version.
I followed this

I used this line from how to install tensorflow gpu in manjaro? (this worked for me even with python 3.8.1):

sudo pacman -Syu cuda cudnn tensorflow-cuda python-pycuda python-tensorflow-cuda python-matplotlib

I also added this line:

sudo pacman -S tensorboard

I dont know why you have another version of the driver installed

If that doesnt work for you. You could try installing anaconda https://www.anaconda.com/distribution/#download-section, then create an environment for tensorflow

conda create -n tf-gpu python=3.7
conda activate tf-gpu
conda install tensorflow-gpu#comes with cuda10.1
python
>>> import tensorflow as tf

If that works, you are now using tensorflow-gpu with anaconda you can exit the environment "tf-gpu" and "base" with:

conda deactivate

This line is depracated in tensorflow newer versions

tf.test.is_gpu_available()
1 Like

Hi,

According to your nvidia smi, you have the 418 driver installed, you need to uninstall it and install the 440 driver, with pacman (linux54-nvidia-440xx package in my case, might be different for if you use another kernel) and then install it with mhwd :

sudo mhwd -i pci video-nvidia-440xx

Also, you might get a black screen when you reboot (like I did), to avoid this just rename this file : /etc/X11/mhwd.d/nvidia.conf

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by