Ubuntu – Failing to initialize Nvidia GPU


I have installed nvidia-current on 12.04 and bumblebee according to these links http://news.softpedia.com/news/How-to-Install-The-Latest-Nvidia-Driver-on-Ubuntu-12-04-295542.shtml AND https://wiki.ubuntu.com/Bumblebee respectively. However when attempting to run optirun I get the following error:

       [ERROR]Cannot access secondary GPU - error: [XORG] (EE) NVIDIA(0): Failed t0 initialize the NVIDIA GPU at PCI:1:0:0.  Please

       [ERROR]Aborting because fallback start is disabled.

I have google this extensively, without being able to find a general consensus on what to do. I have intel core i5, and GEFORCE 740M Nvidia card. I have provided some system info below:

**root@:/home/# lspci -d 10de: -vvnn**
01:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:0fdf] (rev a1)
    Subsystem: ASUSTeK Computer Inc. Device [1043:1587]
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 16
    Region 0: Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
    Region 1: Memory at e0000000 (64-bit, prefetchable) [size=256M]
    Region 3: Memory at f0000000 (64-bit, prefetchable) [size=32M]
    Region 5: I/O ports at e000 [size=128]
    Expansion ROM at f7000000 [disabled] [size=512K]
    Capabilities: [60] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
        Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Address: 0000000000000000  Data: 0000
    Capabilities: [78] Express (v2) Endpoint, MSI 00
        DevCap:    MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 <64us
            ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
        DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
            RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop+
            MaxPayload 256 bytes, MaxReadReq 512 bytes
        DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
        LnkCap:    Port #0, Speed unknown, Width x16, ASPM L0s L1, Latency L0 <512ns, L1 <4us
            ClockPM+ Surprise- LLActRep- BwNot-
        LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
            ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
        LnkSta:    Speed 2.5GT/s, Width x16, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
        DevCap2: Completion Timeout: Range AB, TimeoutDis+
        DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-
        LnkCtl2: Target Link Speed: Unknown, EnterCompliance- SpeedDis-, Selectable De-emphasis: -6dB
             Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
             Compliance De-emphasis: -6dB
        LnkSta2: Current De-emphasis Level: -3.5dB
    Capabilities: [b4] Vendor Specific Information: Len=14 <?>
    Capabilities: [100 v1] Virtual Channel
        Caps:    LPEVC=0 RefClk=100ns PATEntryBits=1
        Arb:    Fixed- WRR32- WRR64- WRR128-
        Ctrl:    ArbSelect=Fixed
        Status:    InProgress-
        VC0:    Caps:    PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
            Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
            Ctrl:    Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
            Status:    NegoPending- InProgress-
    Capabilities: [128 v1] Power Budgeting <?>
    Capabilities: [600 v1] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
    Capabilities: [900 v1] #19
    Kernel driver in use: nvidia
    Kernel modules: nvidia_current, nouveau, nvidiafb

root@:/home/# dmesg | grep bb

[    0.000000] PERCPU: Embedded 14 pages/cpu @f7bb2000 s34176 r0 d23168 u57344
[   15.081790] bbswitch: version 0.6
[   15.081796] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
[   15.081801] bbswitch: Found discrete VGA device 0000:01:00.0: \_SB_.PCI0.PEG0.PEGP
[   15.081882] bbswitch: detected an Optimus _DSM function
[   15.081887] bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is on
[   15.083422] bbswitch: disabling discrete graphics

root@dominic:/home/# dmesg | grep nv

[    2.088239] rtc0: alarms up to one month, y3k, 242 bytes nvram, hpet irqs
[   14.245426] ACPI Error: Current brightness invalid (20120320/video-384)
[  261.089873] nvidia: module license 'NVIDIA' taints kernel.
[  261.488938] nvidia 0000:01:00.0: power state changed by ACPI to D0
[  261.488959] nvidia 0000:01:00.0: power state changed by ACPI to D0
[  261.488970] nvidia 0000:01:00.0: enabling device (0006 -> 0007)

May 14 12:48:31  kernel: [  186.764848] NVRM: loading NVIDIA UNIX x86 Kernel Module  304.88  Wed Mar 27 14:31:12 PDT 2013
May 14 12:51:12  kernel: [  348.405000] NVRM: RmInitAdapter failed! (0x26:0xffffffff:1200)
May 14 12:51:12  kernel: [  348.405018] NVRM: rm_init_adapter(0) failed
May 14 12:55:57  kernel: [  261.489352] NVRM: loading NVIDIA UNIX x86

root@:/home/# uname -a

Linux  3.5.0-28-generic #48~precise1-Ubuntu SMP Wed Apr 24 21:43:05 UTC 2013 i686 i686 i386 GNU/Linux

cat /etc/issue

Ubuntu 12.04.2 LTS \n \l

root@:/home/# dpkg -l|grep nvidia

ii  nvidia-common                                1:                                       Find obsolete NVIDIA drivers
ii  nvidia-current                               304.88-0ubuntu0.0.2                              NVIDIA binary Xorg driver, kernel module and VDPAU library
ii  nvidia-settings                              304.88-0ubuntu0.0.2                              Tool of configuring the NVIDIA graphics driver

/home# cat /etc/bumblebee/bumblebee.conf \

# Configuration file for Bumblebee. Values should **not** be put between quotes

## Server options. Any change made in this section will need a server restart
# to take effect.
# The secondary Xorg server DISPLAY number
# Should the unused Xorg server be kept running? Set this to true if waiting
# for X to be ready is too long and don't need power management at all.
# The name of the Bumbleblee server group name (GID name)
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
# The Driver used by Bumblebee server. If this value is not set (or empty),
# auto-detection is performed. The available drivers are nvidia and nouveau
# (See also the driver-specific sections below)
# Directory with a dummy config file to pass as a -configdir to secondary X

## Client options. Will take effect on the next optirun executed.
# Acceleration/ rendering bridge, possible values are auto, virtualgl and
# primus.
# The method used for VirtualGL to transport frames between X servers.
# Possible values are proxy, jpeg, rgb, xv and yuv.
# List of paths which are searched for the primus libGL.so.1 when using
# the primus bridge
# Should the program run under optirun even if Bumblebee server or nvidia card
# is not available?

# Driver-specific settings are grouped under [driver-NAME]. The sections are
# parsed if the Driver setting in [bumblebeed] is set to NAME (or if auto-
# detection resolves to NAME).
# PMMethod: method to use for saving power by disabling the nvidia card, valid
# values are: auto - automatically detect which PM method to use
#         bbswitch - new in BB 3, recommended if available
#       switcheroo - vga_switcheroo method, use at your own risk
#             none - disable PM completely
# https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods

## Section with nvidia driver specific options, only parsed if Driver=nvidia
# Module name to load, defaults to Driver if empty or unset
# colon-separated path to the nvidia libraries
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path

## Section with nouveau driver specific options, only parsed if Driver=nouveau

/home# cat /etc/bumblebee/xorg.conf.nvidia

Section "ServerLayout"
    Identifier  "Layout0"
    Option      "AutoAddDevices" "false"
    Option      "AutoAddGPU" "false"

Section "Device"
    Identifier  "DiscreteNvidia"
    Driver      "nvidia"
    VendorName  "NVIDIA Corporation"

#   If the X server does not automatically detect your VGA device,
#   you can manually set it here.
#   To get the BusID prop, run `lspci | egrep 'VGA|3D'` and input the data
#   as you see in the commented example.
#   This Setting may be needed in some platforms with more than one
#   nvidia card, which may confuse the proprietary driver (e.g.,
#   trying to take ownership of the wrong device). Also needed on Ubuntu 13.04.
#   BusID "PCI:01:00:0"

#   Setting ProbeAllGpus to false prevents the new proprietary driver
#   instance spawned to try to control the integrated graphics card,
#   which is already being managed outside bumblebee.
#   This option doesn't hurt and it is required on platforms running
#   more than one nvidia graphics card with the proprietary driver.
#   (E.g. Macbook Pro pre-2010 with nVidia 9400M + 9600M GT).
#   If this option is not set, the new Xorg may blacken the screen and
#   render it unusable (unless you have some way to run killall Xorg).
    Option "ProbeAllGpus" "false"

    Option "NoLogo" "true"
    Option "UseEDID" "false"
    Option "UseDisplayDevice" "none"

Best Answer

  • The issue lay with the fact that in both the 12.04 and 13.04 Ubuntu repros nvidia-current is nvidia-304, and this has no support for my Geforce 740M card which is relatively new. Infact the beta driver nvidia-319.12 which supported my chipset only came out in early April, while a more stable driver nvidia-319.17 was only released just over a week ago.

    In order to fix my problem in Ubuntu 13.04, I performed the following:

    sudo add-apt-repository ppa:xorg-edgers/ppa
    sudo apt-get update
    sudo apt-get install nvidia-319

    I then installed bumblebee by the method described by the wiki: https://wiki.ubuntu.com/Bumblebee

    To test, I installed mesa-utils, and ran optirun glxgears with great success!

    The only thing I would like to check now is whether the bumblebee version offered as default by the repro is the latest 3.2.1 released on the 26th of April. Either way it is not a hassle to upgrade.