When I try to switch to my NVIDIA this happens:

ERROR: Traceback (most recent call last):
       File "/usr/share/screen-resolution-extra/nvidia-prime.py", line 22, in
       import sys, dbus, logging
       ImportError: No module named 'dbus'

If it helps there is another error:

** Message: PRIME: Requires offloading
** Message: PRIME: is it supported? yes

ERROR: nvidia-settings could not find the registry key file. This file should
       have been installed along with this driver at
       /usr/share/nvidia/nvidia-application-profiles-key-documentation. The
       application profiles will continue to work, but values cannot be
       prepopulated or validated, and will not be listed in the help text.
       Please see the README for possible values and descriptions.

along with lots of gtk theme parsing errors.

I have GT 635M GPU and I'm running ubuntu 16.04 LTS with gnome desktop installed.

Please help :/

EDIT 1: I tried running

sudo apt-get install python-dbus

and got

python-dbus is already the newest version (1.2.0-3).

Switching GPU still produces the same error.

EDIT 2: I edited the nvidia-prime.py as Sneetsher suggested. Running nvidia-settings won't print the sys.version and sys.path, but this is the output if I run the script directly.

bp@ubuntu:~$ python /usr/share/screen-resolution-extra/nvidia-prime.py 
2.7.11+ (default, Apr 17 2016, 14:00:29) 
[GCC 5.3.1 20160413]
['/usr/share/screen-resolution-extra', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
Usage: /usr/share/screen-resolution-extra/nvidia-prime.py nvidia|intel
  • 1
    Welcome to Ask Ubuntu, That is a python module and could be installed using sudo apt-get install python-dbus. Try it & if it didn't work, edit & update the question with the new error message. – user.dz Jul 11 '16 at 11:28
  • So either corrupted or it uses python3. Try again with sudo apt-get install --reinstall python-dbus python3-dbus – user.dz Jul 11 '16 at 17:00
  • @Sneetsher still the same results. BTW running python in console and typing "import dbus" doesn't produce an error. – Bruno Jul 11 '16 at 17:03
  • open it for edit sudo nano /usr/share/screen-resolution-extra/nvidia-prime.py then comment that line #import sys, dbus, logging and add this instead import sys; print (sys.version); print (sys.path); import dbus, logging to check python version and path used to run this script. – user.dz Jul 11 '16 at 17:17
  • @Sneetsher this is the output (I will edit it to the post) – Bruno Jul 11 '16 at 19:29

I had the same error. I fixed it by running sudo nvidia-settings instead of nvidia-settings. This adds the necessary privileges to launch the application.

| improve this answer | |
  • This worked for me on Ubuntu 17.04. My laptop was running very hot all the time because I couldn't switch from the Nvidia card to the Intel one on my laptop. – rgoliveira Dec 18 '17 at 0:28
  • If you're still having problems with overheating, I'd recommend installing tlp too. I'm glad it worked! – Jesse Jan 22 '19 at 17:56
  • I gave up and went back to Windows + WSL. On Linux I had to switch manually between on-board/off-board, which forced me to logoff and login in order for it to work properly, and it still overheated with the GPU turned on. – rgoliveira Jan 22 '19 at 18:01
  • Fair enough. On the other hand, now you'll incur the overhead of WSL. Best of luck! – Jesse Jan 22 '19 at 18:22

Try switching GPU using terminal. It does not give an error then.


sudo prime-select nvidia


sudo prime-select intel
| improve this answer | |

So I finally fixed the problem. I had to install the latest nvidia drivers (367) and disable safe boot in UEFI. Suddenly it is working.

| 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.