I have a desktop computer with an Nvidia GPU, and the Python machine learning library Theano installed on it. Theano uses the GPU for carrying out certain computations.

When I start IPython and import Theano, I get a notification that the GPU is being used. Likewise, when I run a test script, I get a confirmation about the same. However, I recently added a new user to my computer as follows:

sudo useradd -m -g fbar -G plugdev -s /bin/bash -c "Foo Bar" fbar

This user is unable to access the GPU in the same two cases I just described which worked for me.

I'll also post this in the Theano users group as I'm not sure whether it's a problem with access at the OS level or Python level or the module level. Please let me know if you need any additional information.



On Rich's suggestion, I tried id with both users. Initially the second user (who cannot access the GPU) was not in some of the groups the first one was in. I made them both the members of the same groups. So now id returns the following for both users:

uid=1000(myusername) gid=1000(myusername) groups=1000(myusername),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),124(sambashare)

Only difference is that for the second user uid and gid are 1001. Still he cannot access the GPU.

The output of

$ ls -l /dev/nvidia*

looks like this:

crw-rw-rw- 1 root root 195,   0 May 30 17:42 /dev/nvidia0
crw-rw-rw- 1 root root 195, 255 May 30 17:42 /dev/nvidiactl

Any other suggestions? I'll go read what those columns mean. Thanks!

  • What is the actual command + error message? – l0b0 Jun 2 '14 at 16:14
  • There isn't any error message. The code runs perfectly well. It's just that it uses the CPU when it's actually supposed to use the GPU for the new user. – user1953384 Jun 2 '14 at 16:16
  • 2
    I'd run id as you, and id as the user. My random guess is there's some group permission for some /dev/ node that they don't have group read/write to. – Rich Homolka Jun 2 '14 at 17:08
  • Please have a look at my edit to the post. – user1953384 Jun 3 '14 at 21:52

Ok, so it turns out I was barking up the wrong tree. The group permissions, etc. were all ok. I just had to create a .theanorc file in the second user's home folder with the following code


I should really pay more attention while reading the library documentation. Thanks to those who tried to help!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.