# No NVIDIA driver on the system found

**URL:** <https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307>\
**Category:** General\
**Created:** [6 April 2021 15:40 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307 "2021-04-06T15:40:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anisioti](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/anisioti/32/202_2.png) [@anisioti](https://renku.discourse.group/u/anisioti)\
**Post date:** [6 April 2021 15:40 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/1 "2021-04-06T15:40:53Z")

</div>

Hello,

I am trying to run some pytorch code that uses GPU’s. I have configured my environment with 2 GPUs and I made sure that the code can be run on a GPU by testing on my computer. When running I get the following error that I cannot solve.

 ![image](https://global.discourse-cdn.com/free1/uploads/renku/original/1X/c0bd622cdb8aec3b183eeb23581f8077f695f337.png)

Do you have any suggestions on how I can handle this error?

Thank you very much  
Athina

---

<div class="post-metadata">

**Author:** ![lusamino](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/lusamino/32/227_2.png) [@lusamino](https://renku.discourse.group/u/lusamino)\
**Post date:** [6 April 2021 16:01 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/2 "2021-04-06T16:01:59Z")

</div>

Hi @anisioti !!

Ohh, that is actually a strange error considering you get a correct output from `nvidia-smi`. In any case, could past here the first lines of your `Dockerfile` (contained in root). Perhaps, the environment is not correct…

Also, have you tried on a notebook just importing `torch`, and then:

```
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
n_gpu = torch.cuda.device_count()
torch.cuda.get_device_name(0)

```

There you could really assess if your code will correctly find the `gpu`.

I hope this helps! But as said, please let us know how your `Dockerfile` looks.

Cheers  
Luis

---

<div class="post-metadata">

**Author:** ![anisioti](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/anisioti/32/202_2.png) [@anisioti](https://renku.discourse.group/u/anisioti)\
**Post date:** [6 April 2021 16:15 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/3 "2021-04-06T16:15:45Z")

</div>

Hello!  
Thank you very much for your reply.  
I just tried what you suggested and took the following output, so I think that the code is not finding the gpus. The n\_gpu is zero  
and with torch.cuda.get\_device\_name(0) I am getting an error.

So maybe something is wrong with my environment setup. My dockerfile is the following

 ![image](https://global.discourse-cdn.com/free1/uploads/renku/original/1X/5ecd002d1bd1a424fb6346004e66f1071b460831.png)

Best,  
Athina

---

<div class="post-metadata">

**Author:** ![lusamino](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/lusamino/32/227_2.png) [@lusamino](https://renku.discourse.group/u/lusamino)\
**Post date:** [6 April 2021 16:18 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/4 "2021-04-06T16:18:36Z")

</div>

Hi @anisioti

Then, I believe we found it! 😄 In the `Dockerfile` the Renku version is not a CUDA enabled one. Please, try changing the first two lines by:

```auto
ARG RENKU_BASE_IMAGE=renku/renkulab-cuda10.0-tf1.14:0.7.4
FROM ${RENKU_BASE_IMAGE}

```

Wait for Gitlab to generate the new Docker environment, and try again! I bet it will work now. And if not, here we are to help.

Cheers  
Luis

---

<div class="post-metadata">

**Author:** ![anisioti](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/anisioti/32/202_2.png) [@anisioti](https://renku.discourse.group/u/anisioti)\
**Post date:** [6 April 2021 16:51 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/6 "2021-04-06T16:51:51Z")

</div>

Hello!  
I changed the 2 lines of the docker file and now it looks like this

 ![image](https://global.discourse-cdn.com/free1/uploads/renku/original/1X/0c836f3858995887d21aadd7ab9c916fb114cc20.png)

I also stopped the previous environment I had and created a new one, but still the problem exists.  
Shall I renew another environment or just wait more? (I see you are refering to a docker environment, but I am not sure what this is)

Thank you very much again!  
Athina

---

<div class="post-metadata">

**Author:** ![rrrrrok](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/rrrrrok/32/117_2.png) [@rrrrrok](https://renku.discourse.group/u/rrrrrok)\
**Post date:** [6 April 2021 19:47 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/7 "2021-04-06T19:47:03Z")

</div>

Hi @anisioti - when you are editing the file in your running session, please make sure the Dockerfile is permanently saved in your repository by committing and pushing the file to the server. The easiest way to do this is simply opening a terminal in JupyterLab and running `renku save`.

I took the liberty to have a look at your project and I noticed that the format of your conda `environment.yml` is slightly wrong - the dependencies need to be listed like this:

```auto
dependencies:
  - torch
  - torchvision

```

… and so on. Once you fix this, the image should be able to build properly (you have a [failing job](https://limited.renku.ch/gitlab/anisioti/drug-interactions/pipelines/5196) right now). Hope that helps!

---

<div class="post-metadata">

**Author:** ![anisioti](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/anisioti/32/202_2.png) [@anisioti](https://renku.discourse.group/u/anisioti)\
**Post date:** [7 April 2021 09:50 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/8 "2021-04-07T09:50:14Z")

</div>

I haven’t noticed that I should use - before writing the dependencies  
It worked indeed!  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![rrrrrok](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/rrrrrok/32/117_2.png) [@rrrrrok](https://renku.discourse.group/u/rrrrrok)\
**Post date:** [7 April 2021 11:07 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/9 "2021-04-07T11:07:18Z")

</div>

Hi @anisioti it’s actually still not quite right - at the moment your `environment.yml` looks like this:

```auto
name: "base"
channels:
  - defaults
# dependencies:
# - add packages here
  - torch 
  - torchvision
  - tqdm
  - numpy
  - pandas
  - time
  - sklearn
  - subword_nmt
# - one per line
prefix: "/opt/conda"

```

which says that it should use _channels_ `torch`, `torchvision` etc. It should be like this (with `dependencies` uncommented):

```auto
name: "base"
channels:
  - defaults
dependencies:
  - torch 
  - torchvision
  - tqdm
  - numpy
  - pandas
  - time
  - sklearn
  - subword_nmt
prefix: "/opt/conda"

```

The reason they got installed anyway is because you also have them in the `requirements.txt` file - they only need to be specified in one place.

---

<div class="post-metadata">

**Author:** ![anisioti](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/anisioti/32/202_2.png) [@anisioti](https://renku.discourse.group/u/anisioti)\
**Post date:** [7 April 2021 11:40 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/10 "2021-04-07T11:40:45Z")

</div>

Thank you very much and sorry for the weird mistakes, I haven’t worked with this kind of file before.

I have one more question to make. I see that we are working with python version 3.7. But for some code I need to run I will need python 3.6 with gpu in order to install all the requirements. Is there a way to change this setting? I see the choices for the docker image on the github readme, but I cannot understand what should be written in the first lines of the docker file of the new environment I will need to make.

---

<div class="post-metadata">

**Author:** ![rrrrrok](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/rrrrrok/32/117_2.png) [@rrrrrok](https://renku.discourse.group/u/rrrrrok)\
**Post date:** [7 April 2021 11:47 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/11 "2021-04-07T11:47:06Z")

</div>

No problem at all, the syntax is definitely not super obvious 🙂

It is possible to install a different python version in the image, but it’s not entirely trivial - are you absolutely sure you need python 3.6? If it’s a must, @mitch has done this in the past, I believe… maybe he has an example he can share.

---

<div class="post-metadata">

**Author:** ![mitch](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@mitch](https://renku.discourse.group/u/mitch)\
**Post date:** [7 April 2021 12:10 UTC](https://renku.discourse.group/t/no-nvidia-driver-on-the-system-found/307/12 "2021-04-07T12:10:49Z")

</div>

Hi All, sorry if I am late to the party.

Regarding the `evironment.yml` first. It is best to install torch and torchvision from the torch channels (see [https://pytorch.org/](https://pytorch.org/)). For this, one can specify the channels that differ from `defaults` by simply adding the channel before the package to be installed, e.g. `- pytorch::torch`, so the environment definition will become:

```auto
name: "base"
channels:
  - defaults
dependencies:
  - pytorch::torch 
  - pytorch::torchvision
  - tqdm
  - numpy
  - pandas
  - time
  - sklearn
  - subword_nmt
prefix: "/opt/conda"

```

Regarding the python version, I personally use `pytorch=1.7.1` with python 3.7 (`py3.7_cuda10.1.243_cudnn7.6.3_0` ). I think it is best to stick to that… @rrrrrok I did downgrade it once, but it is kinda messy as renku wants python 3.7 which is the one provided in the docker image. It was much simpler to use 3.7 or even 3.8, torch now provides versions for a variety of CUDA and python combos. And I never used that _within_ a renkulab environment, it was a local env. I would just pin all package versions to make sure that all packages are happy with python 3.7.

@anisioti may I ask you what package must use python 3.6? Maybe I can help more!

Cheers all!
