How to get Debian Jessie to use the nvidia proprietary driver?

5,307

Seems to work! Thanks @cas (see comments on question). I installed bumblebee (from backports, since that's where I installed nvidia-driver and dependents from, as per the wiki):

$ sudo aptitude install -t jessie-backports bumblebee bumblebee-nvidia

and rebooted to make sure everything was working (you probably don't even need to restart the X server, but I was feeling charitable). NB if you haven't yet installed the nvidia driver, I believe this would also pull that in? I haven't tested that though. It may instead pull in nouveau. If when you run primusrun glxinfo you don't see "nvidia" anywhere, this may be what's happened; in that case presumably you can just install debian as per the wiki and it should work (you'd need to reboot then for definite, since it installs a new kernel module).

Then used glxinfo and glxgears to test.

$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.3.2
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.3.2
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 10.3.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.0
OpenGL ES profile extensions:

Note that running glxinfo bare uses the integrated intel graphics (I think mesa used to mean software opengl? I don't know what it means now. But it's clear it's NOT using the discrete card).

$ primusrun glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 940M/PCIe/SSE2
OpenGL core profile version string: 4.4.0 NVIDIA 352.79
OpenGL core profile shading language version string: 4.40 NVIDIA via Cg compiler
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5.0 NVIDIA 352.79
OpenGL shading language version string: 4.50 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:

Success!

Share:
5,307

Related videos on Youtube

allicoder
Author by

allicoder

Updated on September 18, 2022

Comments

  • allicoder
    allicoder over 1 year

    I followed the instructions in the Debian wiki to install the nvidia proprietary graphics driver on Debian Jessie via backports. Unfortunately, despite my best efforts, the X server will not use the new driver.

    The kernel module built and installed correctly:

    $ sudo lsmod | grep nvidia
    nvidia               8487526  0 
    drm                   249955  5 i915,drm_kms_helper,nvidia
    i2c_core               46012  12 drm,i915,i2c_i801,snd_soc_rt5640,i2c_hid,i2c_designware_platform,regmap_i2c,drm_kms_helper,i2c_algo_bit,nvidia,v4l2_common,videodev
    

    With no xorg.conf file, X works fine but does not use the nvidia driver; nvidia-settings reports that I "do not appear to be using the NVIDIA X Driver".

    Xorg.log.0: http://pastebin.com/3Anr3FWU (is this the right way to put this in? I hope so)

    With the following xorg.conf:

    # nvidia-xconfig: X configuration file generated by nvidia-xconfig
    # nvidia-xconfig:  version 340.46  (buildd@brahms)  Tue Oct  7 08:00:32 UTC 2014
    
    Section "ServerLayout"
        Identifier     "Layout0"
        Screen      0  "Screen0"
        InputDevice    "Keyboard0" "CoreKeyboard"
        InputDevice    "Mouse0" "CorePointer"
    EndSection
    
    Section "Files"
    EndSection
    
    Section "InputDevice"
        # generated from default
        Identifier     "Mouse0"
        Driver         "mouse"
        Option         "Protocol" "auto"
        Option         "Device" "/dev/psaux"
        Option         "Emulate3Buttons" "no"
        Option         "ZAxisMapping" "4 5"
    EndSection
    
    Section "InputDevice"
        # generated from default
        Identifier     "Keyboard0"
        Driver         "kbd"
    EndSection
    
    Section "Monitor"
        Identifier     "Monitor0"
        VendorName     "Unknown"
        ModelName      "Unknown"
        HorizSync       28.0 - 33.0
        VertRefresh     43.0 - 72.0
        Option         "DPMS"
    EndSection
    
    Section "Device"
        Identifier     "Device0"
        Driver         "nvidia"
        VendorName     "NVIDIA Corporation"
    EndSection
    
    Section "Screen"
        Identifier     "Screen0"
        Device         "Device0"
        Monitor        "Monitor0"
        DefaultDepth    24
        SubSection     "Display"
            Depth       24
        EndSubSection
    EndSection
    

    (which quotes a version lower than what I expected from the wiki, 352.79 vs 340.46, but is probably nothing), the X server does not start at all (I get a black screen with a blinking cursor, but tty1-6 are available). Same result if I cut out everything but the "Device" section.

    Xorg.log.0: http://pastebin.com/cYLSYiUV

    This is an MSI laptop with nvidia 940M dedicated graphics (and an intel onboard gfx).

    $ lspci | egrep -i "vga|nvidia"
    00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
    01:00.0 3D controller: NVIDIA Corporation Device 1347 (rev a2)
    

    So: how can I get X to start up and use the nvidia driver?

    • Alessio
      Alessio about 8 years
      I see you also have the i915 intel GPU driver module installed...is this a laptop with Optimus graphics? I don't have one and am no expert on them but I remember from a few years ago that there was software called bumblebee that supported them. bumblebee-project.org I also vaguely recall hearing that bumblebee was obsolete or no longer needed, which may be why the last release was in April 2013. Dunno for sure, but worth looking into anyway.
    • Alen Milakovic
      Alen Milakovic about 8 years
      It says No devices detected. What is your video card?
    • Alessio
      Alessio about 8 years
      BTW, bumblebee is packaged for debian. Looks like bumblebee-nvidia is the package to install, it's a meta-package that depends on other related packages and configured opengl to use mesa.
    • allicoder
      allicoder about 8 years
      Ah, of course! The integrated graphics chip is the one that controls the display (github.com/Bumblebee-Project/Bumblebee/wiki/FAQ "How it works" section); so of course if I set my x server to use the nvidia driver exclusively (with the Driver "nvidia" option in xorg.conf), it can't find a display because that card doesn't deal with the display. Yeah, looks like bumblebee is the way to go. Thanks. I'll look into it and report back.
  • allicoder
    allicoder about 8 years
    Apparently I need to do it tomorrow, but will try and remember ^^
  • Alessio
    Alessio about 8 years
    +1 for writing it up as a detailed answer to help others with the same problem.
  • allicoder
    allicoder about 8 years
    @cas my pet hate is people not doing this :P