Fixed Ubuntu 12.04 with NVidia Optimus Technology

Discussion in 'Xiaopan Support' started by estimacamry, 23 Apr 2013.

  1. estimacamry

    estimacamry Tracker
    VIP

    Joined:
    3 Aug 2012
    Messages:
    552
    Likes Received:
    131
    Trophy Points:
    91
    Been using Window for years and a week ago tried installing Linux, Ubuntu 12.04 to be precise into my lappy. My notebook specs:

    Notebook - Lenovo G580
    Processor - Intel® Core™ i5-3210M CPU @ 2.50GHz × 4
    OS Type - 32-bit
    Video Card - GeForce GT630M ( NVIDIA® Optimus™ technology )

    Tested so many ways of getting the right procedure of installing the Nvidia drivers but ended up reinstalling my OS a dozen times:mad: till I saw this tutorial http://eternalvoid.net/tutorials/linux-optimus-gt650m/ . Managed to installed as per described. So here I'm gonna shared what I've done to get my card working.

    Please do this at your own RISK and you will break your system if anything goes wrong. So please backup all your important data before proceeding with it.
    Code:
    Select All
    sudo add-apt-repository ppa:bumblebee/stable sudo add-apt-repository ppa:ubuntu-x-swat/x-updates sudo apt-get update sudo apt-get upgrade sudo apt-get install build-essential git automake autoconf libtool virtualgl bbswitch-dkms sudo apt-get build-dep bumblebee bumblebee-nvidia
    Check if the nouveau kernel module is loaded:
    Code:
    Select All
    lsmod | grep nouveau
    If you see any output from that command, blacklist the nouveau module, otherwise skip the next two lines:
    Code:
    Select All
    sudo su - echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf echo "blacklist nvidia" >> /etc/modprobe.d/blacklist.conf
    REBOOT
    Download NVIDIA driver>> I used "NVIDIA-Linux-x86-319.12.run"
    Code:
    Select All
    chmod +x ./NVIDIA-Linux-x86-319.12.run sudo ./NVIDIA-Linux-x86-319.12.run --no-recursion --no-rpms --no-distro-scripts --no-x-check --dkms --x-prefix=/usr/nvidia --x-module-path=/usr/lib/xorg/nvidia/modules --x-library-path=/usr/nvidia/lib --opengl-prefix=/usr/nvidia --utility-prefix=/usr/nvidia --documentation-prefix=/usr/nvidia -e -q
    REBOOT
    Code:
    Select All
    mkdir -p ~/src cd src git clone https://github.com/Bumblebee-Project/Bumblebee.git cd Bumblebee git checkout v3.0.1 autoreconf -fi ./configure --prefix=/usr --sysconfdir=/etc CONF_DRIVER=nvidia CONF_DRIVER_MODULE_NVIDIA=nvidia CONF_LDPATH_NVIDIA=/usr/nvidia/lib:/usr/nvidia/lib:/usr/lib/xorg/nvidia/modules/drivers:/usr/lib/xorg/nvidia/modules/extensions:/usr/lib/xorg/nvidia/modules:/usr/lib/xorg/modules:/usr/lib/xorg/modules/drivers:/usr/lib/xorg/modules/extensions CONF_MODPATH_NVIDIA=/usr/lib/xorg/nvidia/modules/drivers,/usr/lib/xorg/nvidia/modules,/usr/lib/xorg/modules make sudo make install sudo groupadd bumblebee sudo addgroup <your_username_here>bumblebee sudo cp -a scripts/sysvinit/bumblebeed /etc/init.d sudo chmod 755 /etc/init.d/bumblebeed cd /etc/rc2.d sudo ln -s ../init.d/bumblebeed S20bumblebeed sudo mv /usr/lib/xorg/nvidia/modules/libwfb.so /usr/lib/xorg/nvidia/modules/libwfb.so.bak
    REBOOT
    Code:
    Select All
    sudo nano /etc/bumblebee/xorg.conf.nvidia
    Change:
    Option "ConnectedMonitor" "DFP"
    to
    Option "ConnectedMonitor" "CRT"
    Save and exit
    Now you need the special "Lenovo Hack" (Only for Lenovo and Toshiba notebook)
    Code:
    Select All
    git clone git://github.com/Bumblebee-Project/bbswitch.git -b hack-lenovo cd bbswitch sudo mkdir /usr/src/acpi-handle-hack-0.0.2 sudo cp Makefile acpi-handle-hack.c /usr/src/acpi-handle-hack-0.0.2 sudo cp dkms/acpi-handle-hack.conf /usr/src/acpi-handle-hack-0.0.2/dkms.conf sudo dkms install -m acpi-handle-hack -v 0.0.2 echo acpi-handle-hack | sudo tee -a /etc/modules sudo update-initramfs -u
    REBOOT
    Code:
    Select All
    sudo modprobe acpi-handle-hack
    Ok now test to see if everything is in order, run "glxspheres" then "optirun glxspheres" in terminal to see the difference!
    glxspheres.png
    After getting all this ready, I've also installed "aircrack-ng" and "crunch" into my system.
    Now my big question is "How can I install cudatoolkit and pyrit into Ubuntu 12.04"?? I've tried installing following this tutorial http://sn0v.wordpress.com/2012/12/07/installing-cuda-5-on-ubuntu-12-04/ and I end up with a "Black Screen" during startup.
    Anyone out there willing to help me get through this, I've come a long way and I'm not going to give up easily;)
    Mr. Penguin meknb ImJoJo Crackerz Wave Aby$m and all Ubuntu sifus
    Credit to Defcronyke from http://eternalvoid.net/tutorials/linux-optimus-gt650m/ and
    Lekensteyn from https://github.com/Bumblebee-Projec...o-ideapad-y470y570-and-toshiba-satellite-p870
     
    • Like Like x 1
  2. thaijack

    thaijack Active Member

    Joined:
    28 May 2012
    Messages:
    11
    Likes Received:
    3
    Trophy Points:
    43
    Best information for sharing
     
  3. meknb

    meknb Mod
    Moderator Dev Team VIP

    Joined:
    2 Jun 2012
    Messages:
    702
    Likes Received:
    144
    Trophy Points:
    161
    Any clues in your dmesg try ctrl alt backspace to kill window server,or it may be alt ctrl f1 for console ?? do you get any external output vga ??
    Also did you purge the nvidia drivers before you installed the new ones
    Code:
    Select All
    sudo apt-get purge nvidia*
     
  4. estimacamry

    estimacamry Tracker
    VIP

    Joined:
    3 Aug 2012
    Messages:
    552
    Likes Received:
    131
    Trophy Points:
    91
    meknb
    Honestly I'm still a big NOOB on Ubuntu, will try to understand what you are trying to deliver:p
    1. I tried installing cudatoolkit this way
    Code:
    Select All
    sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
    Does installing all this break my system?
    2. I used this version cuda_5.0.35_linux_32_ubuntu11.10-1.run
    Code:
    Select All
    chmod +x ./cuda_5.0.35_linux_32_ubuntu11.10-1.run sudo ./cuda_5.0.35_linux_32_ubuntu11.10-1.run
    I install the toolkit only, skip the driver(Already had one installed) and skip the samples(Thought it was not necessary). Is this OK?
    After installing, I added the path to /root/.bashrc
    Code:
    Select All
    export PATH=$PATH:/usr/local/cuda-5.0/bin export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib
    3. Do I need to be in tty1/2/3 to install cudatoolkit?
    Code:
    Select All
    sudo service lightdm stop
    4. Is this necessary before installing cudatoolkit?

    I had install the driver, why do I need to install a new one?
    Lastly thanks for helping out:D
     
  5. Crackerz Wave

    Crackerz Wave The Dictator
    Staff Member Moderator VIP

    Joined:
    20 May 2012
    Messages:
    650
    Likes Received:
    128
    Trophy Points:
    141
    how about installing nvidial gt750m?
     
  6. meknb

    meknb Mod
    Moderator Dev Team VIP

    Joined:
    2 Jun 2012
    Messages:
    702
    Likes Received:
    144
    Trophy Points:
    161
    I'm a noob when it comes to ubuntu i avoid it, not my fav os lol
    I'd purge before step 2 and install the drivers from the .run install,I think the ones already install are built into the kernel and rely on the nouveau frame buffer.
    Another place to look to see what went wrong is your xorg.0.log probably in /var/log/
     
  7. estimacamry

    estimacamry Tracker
    VIP

    Joined:
    3 Aug 2012
    Messages:
    552
    Likes Received:
    131
    Trophy Points:
    91
    meknb
    I've managed to install cudatoolkit and pyrit into my notebook
    Code:
    Select All
    estima@optimus:~$ pyrit Pyrit 0.4.0 (C) 2008-2011 Lukas Lueg http://pyrit.googlecode.com This code is distributed under the GNU General Public License v3+
    :D
    Now my new problem:p install cpyrit_cuda, when I tried I get this
    Code:
    Select All
    estima@optimus:~/cpyrit-cuda-0.4.0$ python setup.py build svn: '.' is not a working copy running build running build_ext Skipping rebuild of Nvidia CUDA kernel ... Building modules... building 'cpyrit._cpyrit_cuda' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/cuda/include -I/usr/include/python2.7 -c _cpyrit_cuda.c -o build/temp.linux-i686-2.7/_cpyrit_cuda.o -Wall -fno-strict-aliasing -DVERSION="0.4.0" gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-i686-2.7/_cpyrit_cuda.o -lcrypto -lcuda -lz -o build/lib.linux-i686-2.7/cpyrit/_cpyrit_cuda.so /usr/bin/ld: cannot find -lcuda collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1
    Anyone?? Thanks
     
  8. meknb

    meknb Mod
    Moderator Dev Team VIP

    Joined:
    2 Jun 2012
    Messages:
    702
    Likes Received:
    144
    Trophy Points:
    161
    Looks like a broken symbolic link.
    Have a look in the setup.py or any readmes for export path option If there isn't one create a link
    Code:
    Select All
    sudo ln -s /usr/lib/nvidia-current/libcuda.so /usr/lib/libcuda.so
    or add to your .bash_profile
    Code:
    Select All
    export PATH=/usr/local/cuda/bin:$PATH export LPATH=/usr/lib/nvidia-current:$LPATH export LIBRARY_PATH=/usr/lib/nvidia-current:$LIBRARY_PATH export LD_LIBRARY_PATH=/usr/lib/nvidia-current:/usr/local/cuda/lib64:/usr/local/cuda/lib:$LD_LIBRARY_PATH
    change lib64 to lib if on a 32bit system
     
  9. estimacamry

    estimacamry Tracker
    VIP

    Joined:
    3 Aug 2012
    Messages:
    552
    Likes Received:
    131
    Trophy Points:
    91
    I thought so too, I believe its not pointing to the correct path thus can't locate certain files ( noob understanding ):p . So following the tutorial I had install my Nvidia driver with this command
    Code:
    Select All
    chmod +x ./NVIDIA-Linux-x86-319.12.run sudo ./NVIDIA-Linux-x86-319.12.run --no-recursion --no-rpms --no-distro-scripts --no-x-check --dkms --x-prefix=/usr/nvidia --x-module-path=/usr/lib/xorg/nvidia/modules --x-library-path=/usr/nvidia/lib --opengl-prefix=/usr/nvidia --utility-prefix=/usr/nvidia --documentation-prefix=/usr/nvidia -e -q
    For the bash profile, I've notice that I don't have this usr/lib/nvidia-current but I have this usr/lib/nvidia and in this nvidia folder I have this file "pre-install" the content of the file
    Code:
    Select All
    #!/bin/sh # Trigger an error exit status to prevent the installer from overwriting # Ubuntu's nvidia packages. exit 1
    I have also a "nvidia" folder in usr >> /usr/nvidia (it has 3 folder in it >> bin , lib , share)
    In /usr/local I have 2 cuda folder >> cuda and cuda-5.0
    Hopefully you can point me to the correct path meknb to modify the /root/.bashrc scripts so I can eventually install cpyrit-cuda-0.4.0;)
     
  10. meknb

    meknb Mod
    Moderator Dev Team VIP

    Joined:
    2 Jun 2012
    Messages:
    702
    Likes Received:
    144
    Trophy Points:
    161
  11. estimacamry

    estimacamry Tracker
    VIP

    Joined:
    3 Aug 2012
    Messages:
    552
    Likes Received:
    131
    Trophy Points:
    91
    meknb
    Managed to locate "libcuda.so" in /usr/nvidia/lib so I did this
    Code:
    Select All
    sudo ln -s /usr/nvidia/lib/libcuda.so /usr/lib/libcuda.so sudo ldconfig
    Cpyrit-cuda build/installed without error. Thanks a million meknb for helping me getting through this;)
    cpyrit-cuda.png
    Mr. Penguin please mark this thread as SOLVED:D
     
    • Like Like x 1
  12. meknb

    meknb Mod
    Moderator Dev Team VIP

    Joined:
    2 Jun 2012
    Messages:
    702
    Likes Received:
    144
    Trophy Points:
    161
    No problem i should have read your install command --x-library-path=/usr/nvidia/lib would have got there sooner
     
  13. estimacamry

    estimacamry Tracker
    VIP

    Joined:
    3 Aug 2012
    Messages:
    552
    Likes Received:
    131
    Trophy Points:
    91
    Mr. Penguin meknb
    I tried to install Inflator 1.0 to my ubuntu after reading some tutorial. Did "dpkg -i *.deb" then I was told to do this
    Code:
    Select All
    cp ~/.bashrc .bashrc_backup printf “PATH=$%sPATH:%s/bin/inflator/\n” | tee -a ~/.bashrc
    After entering those commands, my Inflator is not running but I get some lines everytime I run a terminal:( Anyway can I remove those lines?
    inflator.png
    Sorry to bother you guys again:p
     
  14. Mr. Penguin

    Mr. Penguin Administrator
    Staff Member Admin Moderator VIP

    Joined:
    18 May 2012
    Messages:
    3,087
    Likes Received:
    1,187
    Trophy Points:
    351
    That command should be unnecessary. Could you check the MD5 of the attached file and if different, try it? Also

    Are you using 32bit? If not try:

    Code:
    Select All
    sudo apt-get install ia32-libs cd 'Folder Location' su -c dpkg -i --force-architecture inflator.deb sudo dpkg -i --force-architecture inflator.deb
    One of the last two commands should work.
     

    Attached Files:

  15. estimacamry

    estimacamry Tracker
    VIP

    Joined:
    3 Aug 2012
    Messages:
    552
    Likes Received:
    131
    Trophy Points:
    91
    Download Inflator 1.0 from your attachment and did
    Code:
    Select All
    sudo dpkg -i --force-architecture <inflatorfilename>.deb
    By clicking at the Inflator icon gives me nothing but I can run using terminal
    Code:
    Select All
    sudo /bin/inflator/inflator
    How can I run by clicking at the icon which is located in "Installed Programme" ??
    Thanks
     
  16. Mr. Penguin

    Mr. Penguin Administrator
    Staff Member Admin Moderator VIP

    Joined:
    18 May 2012
    Messages:
    3,087
    Likes Received:
    1,187
    Trophy Points:
    351
  17. estimacamry

    estimacamry Tracker
    VIP

    Joined:
    3 Aug 2012
    Messages:
    552
    Likes Received:
    131
    Trophy Points:
    91
    Mr. Penguin
    Thanks for sharing a good link, is creates a shortcut on my desktop but by clicking at the newly develop "inflator" icon still doesn't start the programme. After some browsing I managed to fixed the problem and created a new "inflator" icon in /usr/share/application by running these commands
    Code:
    Select All
    sudo gedit /usr/share/applications/Inflator.desktop
    Created a new desktop entry with these lines
    Code:
    Select All
    [Desktop Entry] Version=3 Type=Application Terminal=false StartupNotify=true Icon=/bin/inflator/inflator_icon.png Name=Inflator Comment= Exec=gksu "/bin/inflator/inflator" Categories=Application;Development;
    Save and exit then Reboot.
    Hopefully these information will help some other newbies like me:D
    inflator.png
     
    • Like Like x 1
  18. zting-newibie

    zting-newibie Member

    Joined:
    11 Jan 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    6
    1. sudo addgroup <your_username_here>bumblebee

      The username is how? like estima@optimus, then i should type sudo addgroup estima bumblebee?​
    --- Double Post Merged, 11 Jan 2014 ---
    1. sudo addgroup <your_username_here>bumblebee​
    how to type
    <your_username_here>?
     
    #18 zting-newibie, 11 Jan 2014
    Last edited: 11 Jan 2014
  19. estimacamry

    estimacamry Tracker
    VIP

    Joined:
    3 Aug 2012
    Messages:
    552
    Likes Received:
    131
    Trophy Points:
    91
    actual Linux regular user account name
     
  20. zting-newibie

    zting-newibie Member

    Joined:
    11 Jan 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    6
    so is how? and one more problem
    zting@zting-ubuntu:~$ sudo modprobe acpi-handle-hack
    FATAL: Module acpi_handle_hack not found.


    I run this command, and the result is correct or not?
    --- Double Post Merged, 11 Jan 2014 ---
    Please help! Is very urgent now!! :'(
    --- Double Post Merged, 11 Jan 2014 ---
    [ 2182.778172] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) No devices detected. [ 2182.778261] [ERROR]Aborting because fallback start is disabled.

    Why no devices detected?
     
    #20 zting-newibie, 11 Jan 2014
    Last edited: 11 Jan 2014
Loading...
  • About Us

    We are a community mixed with professionals and beginners with an interest in wireless security, auditing and pentesting. Feel free to check out and upload resources.


    You can also find us on: Twitter and Facebook

  • Donate to Us

    Did you find our forums useful? Feel free to donate Bitcoin to us using the form below. Those who donate the equivlent of $10 USD or more will be upgraded to VIP membership. Don't have Bitcoin? Use your credit card to GO VIP here. Don't want to fork out some coin? There are other ways to GO VIP. Bitcoin: 1LMTGSoTyJWXuy2mQkHfgMzD7ez74x1Z8K