Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 36

Thread: Information about Nvidia optimus support

  1. #11
    Join Date
    Nov 2009
    Location
    Queensland
    Beans
    174
    Distro
    Ubuntu 15.04 Vivid Vervet

    Re: Information about Nvidia optimus support

    Check to see that the linux-headers are installed to match the kernel you have.

  2. #12
    Join Date
    Aug 2012
    Beans
    35

    Re: Information about Nvidia optimus support

    Quote Originally Posted by Mahler122 View Post

    Another way is being pursued by david airlie in the form of enhancements to the xorg server and freedesktop drivers to allow gpu offloading, which he is calling PRIME. here, here, and here....
    ....Hopefully soon I will be able to post how to get it working.

    Well, I have got Dave Airlies Prime stuff running on Ubuntu. Great work. Prime with nouveau outperforms bumblebee with Nvidiablob drastically - no more loss due to the 2nd Xserver/virtualGL. If anybody is interested, mention it, since that stuff is highly experimental, I prefer not posting a HowTo here.

  3. #13
    Join Date
    Apr 2006
    Beans
    20

    Re: Information about Nvidia optimus support

    Hi,

    does anyone knows when this packages will be available in Ubuntu? maybe in 12.10 or we'll have to wait until 13.04?

    pogopuschel, an Ubuntu's howto would be great ^^

  4. #14
    Join Date
    Sep 2009
    Location
    Netherlands
    Beans
    115
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Information about Nvidia optimus support

    Quote Originally Posted by Trevice View Post
    Hi,

    does anyone knows when this packages will be available in Ubuntu? maybe in 12.10 or we'll have to wait until 13.04?

    pogopuschel, an Ubuntu's howto would be great ^^
    Having support from default repositories in 12.10 is too optimistic, maybe 13.04. Maybe a PPA will become available during 12.10. See also https://blueprints.launchpad.net/ubu...ybrid-graphics

    Xorg 1.13 should become available soon in which PRIME support is merged. Mesa master also contains support for PRIME. Now the intel/nouveau drivers need to have PRIME support merged. My outdated notes which I have linked before largely applies, though you need to check if there is a more recent git branch to try and use the xorg git repo instead of the airlied one.

  5. #15
    Join Date
    Aug 2012
    Beans
    35

    Re: Information about Nvidia optimus support

    The information in this post is out of date, for an updated an shorter howto see post #20

    Quote Originally Posted by Trevice View Post
    Hi,

    does anyone knows when this packages will be available in Ubuntu? maybe in 12.10 or we'll have to wait until 13.04?
    Should be available in 12.10. If not, there will be a PPA for prime stuff I guess.
    Quote Originally Posted by Trevice View Post
    pogopuschel, an Ubuntu's howto would be great ^^
    Ok, for those who cannot wait:
    May take 2 hours, depending on your internet connection. Ensure your laptop is properly cooled when it comes to compiling the packages.
    First you need a 12.10 install, do not add "3rd party software" during install, or you will get the nvidia driver which we do not want. Add "Quantal proposed" and Xorgedgers PPA to your software sources, update system. Make sure to get kernel 3.5.0-6-generic or later. reboot of course when necessary.
    Then you have to install all packages needed to build the "prime" stuff:
    Code:
    sudo apt-get build-dep xserver-xorg-video-intel libdrm xorg xserver-xorg-video-nouveau mesa
    sudo apt-get install mesa-utils asciidoc autoconf automake autotools-dev bison docbook-utils doxygen flex fop git-core gperf intltool jadetex libfontconfig1-dev libfreetype6-dev libglib2.0-dev libncurses5-dev libpng12-dev libssl-dev libtool libudev-dev llvm m4 netpbm psutils systemtap-sdt-dev w3m xmlto zlib1g-dev libice-dev libsm-dev libxi-dev libxmu-dev libxmu-headers libxt-dev libxrender-dev mtdev-tools libxfont-dev x11proto-bigreqs-dev x11proto-xcmisc-dev x11proto-record-dev libxcomposite-dev x11proto-composite-dev x11proto-scrnsaver-dev x11proto-resource-dev xdmx xdmx-tools libmtdev-dev xorg-dev xserver-xorg-input-kbd nouveau-firmware
    sudo apt-get purge nvidia*
    Get the sources:
    Code:
    mkdir prime
    cd prime
    git clone git://anongit.freedesktop.org/git/xorg/util/macros
    git clone git://anongit.freedesktop.org/mesa/drm
    git clone git://anongit.freedesktop.org/mesa/mesa
    git clone --depth 1 git://people.freedesktop.org/~airlied/xrandr -b prime
    git clone git://people.freedesktop.org/~airlied/xf86-video-intel -b prime-proposed
    git clone git://people.freedesktop.org/~airlied/xf86-video-nouveau -b prime
    wget http://xorg.freedesktop.org/releases/individual/proto/dri2proto-2.8.tar.bz2
    wget http://xorg.freedesktop.org/releases/individual/lib/libXrandr-1.4.0.tar.bz2
    wget http://xorg.freedesktop.org/releases/individual/proto/randrproto-1.4.0.tar.bz2
    wget http://xorg.freedesktop.org/releases/individual/xserver/xorg-server-1.12.99.903.tar.bz2
    wget http://xorg.freedesktop.org/releases/individual/driver/xf86-input-synaptics-1.6.2.tar.bz2
    wget http://xorg.freedesktop.org/releases/individual/driver/xf86-input-evdev-2.7.1.tar.bz2
    Unpack:
    Code:
    tar jxvf xorg-server-1.12.99.903.tar.bz2
    tar jxvf libXrandr-1.4.0.tar.bz2
    tar jxvf randrproto-1.4.0.tar.bz2
    tar jxvf dri2proto-2.8.tar.bz2
    tar jxvf xf86-input-synaptics-1.6.2.tar.bz2
    tar jxvf xf86-input-evdev-2.7.1.tar.bz2
    Patching mesa:
    Code:
    wget -O prime-support-for-mesa.patch http://cgit.freedesktop.org/~airlied/mesa/patch/?id=444159aae6a0a9b9cc0514f34ba754469b0d2dc2
    Code:
    patch -d mesa -p1 < prime-support-for-mesa.patch
    Patching xserver:
    Code:
    sed -i 's/AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@/AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@ @GL_CFLAGS@/' xorg-server-1.12.99.903/hw/xfree86/dixmods/Makefile.am
    Building all:
    Code:
    cd macros
    ./autogen.sh --prefix=/opt/xorg
    sudo make install
    cd ..
    export ACLOCAL="aclocal -I /opt/xorg/share/aclocal"
    export PKG_CONFIG_PATH=/opt/xorg/lib/pkgconfig:/opt/xorg/share/pkgconfig:/opt/mesa/lib/pkgconfig:${PKG_CONFIG_PATH}
    export LD_LIBRARY_PATH=/opt/xorg/lib:${LD_LIBRARY_PATH}
    export LD_RUN_PATH=/opt/xorg/lib:${LD_RUN_PATH}
    # do not close/change terminal until everything is built ! (Or repeat  export)                   
    cd randrproto-1.4.0
    ./configure --prefix=/opt/xorg
    sudo make install
    cd..
    cd libXrandr-1.4.0
    ./configure --prefix=/opt/xorg
    make
    sudo make install
    cd ..
    cd xrandr
    ./autogen.sh --prefix=/opt/xorg
    make
    sudo make install
    cd ..
    cd dri2proto-2.8
    ./configure --prefix=/opt/xorg
    sudo make install
    cd ..
    cd drm
    ./autogen.sh \
        --prefix=/opt/xorg \
        --enable-udev \
        --enable-intel \
        --disable-radeon \
        --enable-vmwgfx-experimental-api \
        --enable-nouveau
    make
    sudo make install
    cd ..
    cd mesa
    ./autogen.sh \
        --prefix=/opt/mesa \
        --with-gallium-drivers=nouveau,swrast,svga \
        --with-dri-drivers=i915,i965,nouveau,swrast \
        --enable-gallium-llvm \
        --enable-shared-glapi \
        --enable-gallium-egl \
        --enable-egl \
        --enable-dri \
        --enable-glx \
        --enable-xa \
        --enable-shared-dricore
    make
    sudo make install
    cd ..
    cd xorg-server-1.12.99.903
    autoreconf -fi
      ./configure --prefix=/opt/xorg \
          --enable-ipv6 \
          --enable-dri \
          --enable-dmx \
          --enable-xvfb \
          --enable-xnest \
          --enable-composite \
          --enable-xcsecurity \
          --enable-xorg \
          --enable-glx-tls \
          --enable-kdrive \
          --enable-kdrive-evdev \
          --enable-kdrive-kbd \
          --enable-kdrive-mouse \
          --enable-install-setuid \
          --enable-config-udev \
          --disable-config-dbus \
          --enable-record \
          --disable-xfbdev \
          --disable-xfake \
          --disable-xephyr \
          --disable-static \
          --localstatedir=/var \
          --with-xkb-path=/usr/share/X11/xkb \
          --with-xkb-output=/var/lib/xkb \
          --with-fontrootdir=/usr/share/fonts
    make
    sudo make install
    cd ..
    cd xf86-video-intel
    ./autogen.sh \
        --prefix=/usr \
        --enable-dri
    make
    sudo make install
    cd ..
    cd xf86-video-nouveau
    ./autogen.sh \
        --prefix=/usr 
    make
    sudo make install
    cd ..
    cd xf86-input-evdev-2.7.1
    ./configure --prefix=/opt/xorg 
    make
    sudo make install
    cd ..
    cd xf86-input-synaptics-1.6.2
    ./configure --prefix=/opt/xorg 
    make
    sudo make install
    Create Symlinks:
    Code:
    echo '/opt/xorg/lib' | sudo tee -a /etc/ld.so.conf.d/startprime.conf
    echo 'export LD_LIBRARY_PATH=/opt/xorg/lib:$LD_LIBRARY_PATH' | sudo tee -a /etc/profile.d/loadX.sh
    echo 'export PATH=/opt/xorg/bin:$PATH' | sudo tee -a /etc/profile.d/loadX.sh
    sudo cp /usr/bin/X /usr/bin/X.backup
    sudo ln -s /usr/bin/X /opt/xorg/bin/xorg
    Finished. Log out, change session from "Unity" to "Unity2D" (bug in unity3D with new mesa), log in to check if your new Xserver is running:
    Code:
    which X
    .. should show
    /opt/xorg/bin/X

    Finally testing "prime" :

    Load new mesa:
    Code:
    export LD_LIBRARY_PATH=/opt/mesa/lib
    Get the needed provider id
    Code:
    xrandr --listproviders
    if output shows eg:

    Provider 0: id: 111 cap: b nc: 2 no: 4 nap 1 name:Intel
    Provider 1: id: 68 cap: 5 nc: 2 no: 3 nap 1 name:nouveau

    ... the needed provider ids are 111 and 68.

    Using those provider ids:
    Code:
    xrandr --setprovideroffloadsink 68 111
    Now prime is "up". Start an application on the Nvidia GPU using the nouveau driver by prefixing "DRI_PRIME=1" , eg:
    Code:
    DRI_PRIME=1 glxinfo
    should show something like:
    Code:
    OpenGL vendor string: nouveau
    OpenGL renderer string: Gallium 0.4 on NVC1
    OpenGL version string: 3.0 Mesa 8.1-devel (git-61b62c0)
    OpenGL shading language version string: 1.30
    If you get a black or garbaged window when running eg.
    Code:
    DRI_PRIME=1 glxgears
    or
    Code:
    DRI_PRIME=1 openarena
    and your kernellog gets flooded with pgraph errors, grab the window to enlarge it a bit (glxgears). For openarena you have to start it on the Intel GPU first and set it to fullscreen, then you can start openarena on nouveau successfully.
    Powermanagement can be done easily with switcheroo.

    I have testet Dave Airlies great work on an Optimus machine with a GT 420M, a Fermi GPU. On Kepler GPUs there might be problems running nouveau.

    Special credits to Lekensteyn for his "prime scratchbook" (arch linux) and to
    Airlied, Samsagax and mlankhorst for support.
    Last edited by cariboo; September 5th, 2012 at 04:20 PM. Reason: minor

  6. #16
    Join Date
    May 2007
    Beans
    100
    Distro
    Ubuntu

    Re: Information about Nvidia optimus support

    @pogopuschel: thanks for the guide, I got it working after a couple of hiccups. There was a typo in the build code (cd.. instead cd ..). I used xserver 1.12.99.905 instead of .903 and the latest nouveau/intel code from git, as the patches are now in there for prime. I didn't need to patch mesa - the patch was already in the git code. I also didn't uninstall nvidia or bumblebee (but bumblebee blacklists the nvidia driver so it doesn't conflict with the nouveau driver).

    At first xrandr --listproviders only listed the intel card, but after I rebooted, manually forced the nvidia card on and manually modprobed the nvidia driver, xrandr --listproviders... crashed X completely! But when I logged back in and tried again, it worked and found the nvidia card.

    Do you know what causes the PGRAPH errors and if there are any other workarounds? Resizing the window worked for glxspheres - the window had to be larger than a certain size to work - but I wanted to try out prime-nouveau with wine, and since I couldn't resize the screen, I didn't get any output.

  7. #17
    Join Date
    Aug 2012
    Beans
    35

    Re: Information about Nvidia optimus support

    @rockorequin
    Guess there is no need at all to build mesa, since 9.0 is already available in xorgedgers PPA. No time to test this now ..
    Thanks for mentioning typo; could you post the links to updated stuff for others being interested?

    No idea about those pgraph errors; I hoped it was fixed
    Last edited by pogopuschel; September 4th, 2012 at 10:23 PM. Reason: pgraph

  8. #18
    Join Date
    May 2007
    Beans
    100
    Distro
    Ubuntu

    Re: Information about Nvidia optimus support

    I used the official master git code (I think) for nouveau and intel (ie I didn't need the prime branches):

    nouveau:


    intel:


    and there should be similar support for ATI as well:

    So I guess these should also appear soon in xorg-edgers.

    Since resizing the glxpsheres window fixes the PGRAPH errors (at least it does if you resize it to above a certain size), perhaps prime isn't sending the window's size to the offloaded GPU? It's pretty fundamental so I also hope it gets fixed soon.

  9. #19
    Join Date
    May 2007
    Beans
    100
    Distro
    Ubuntu

    Re: Information about Nvidia optimus support

    I just installed xorg-edgers and the latest nouveau/intel from git. The default xrandr command doesn't support --listproviders, but running

    Code:
    /opt/xorg/xrandr --listproviders
    (ie the one I built from git://people.freedesktop.org/~airlied/xrandr -b prime) after I enable the nvidia card and sudo modprobe nouveau now gives me:

    Providers: number : 2
    Provider 0: id: 69 cap: b nc: 2 no: 4 nap 0 name:Intel
    Provider 1: id: 379 cap: 2 nc: 2 no: 2 nap 0 name:modesetting

    which apart from the 'modesetting' name instead of 'nouveau' is a problem because

    Code:
    /opt/xorg/xrandr --setprovideroffloadsink 379 69
    gives a BadValue error for 379.

  10. #20
    Join Date
    Aug 2012
    Beans
    35

    Re: Information about Nvidia optimus support

    @rockorequin
    Just testet daily snapshot 12.10. Everything is now in xorgedgers, besides xrandr. Guess your problems with the modesetting driver instead of nouveau is due to the fact you
    have not purged nvidia or have installed bumblebee, which blacklists the nouveau driver by creating bumblebee.conf in /etc/modprobe.d with this content:
    Code:
    # installed by bumblebee-nvidia
    
    # do not automatically load nouveau as it may prevent nvidia from loading
    blacklist nouveau
    # do not automatically load nvidia as it's unloaded anyway when bumblebeed
    # starts and may fail bumblebeed to disable the card in a race condition.
    blacklist nvidia
    blacklist nvidia-current
    blacklist nvidia-current-updates


    Updated HowTo:
    Install daily built of 12.10, activate Quantal proposed, source code and add xorgedgers PPA.

    Code:
    sudo apt-get build-dep xserver-xorg-video-intel xserver-xorg-video-nouveau xorg
    sudo apt-get install mesa-utils asciidoc autoconf automake autotools-dev bison docbook-utils doxygen flex fop git-core gperf intltool jadetex libfontconfig1-dev libfreetype6-dev libglib2.0-dev libncurses5-dev libpng12-dev libssl-dev libtool libudev-dev llvm m4 netpbm psutils systemtap-sdt-dev w3m xmlto zlib1g-dev libice-dev libsm-dev libxi-dev libxmu-dev libxmu-headers libxt-dev libxrender-dev mtdev-tools libxfont-dev x11proto-bigreqs-dev x11proto-xcmisc-dev x11proto-record-dev libxcomposite-dev x11proto-composite-dev x11proto-scrnsaver-dev x11proto-resource-dev xdmx xdmx-tools libmtdev-dev xorg-dev xserver-xorg-input-kbd nouveau-firmware
    (maybe you not need the whole bunch, since xserver not needs to get built anymore)
    Reboot.
    After reboot X was broken (guess due to broken Intel driver from Xorgedgers), so had to reboot in recovery mode, resume normal boot, which works using llvmpipe. Then
    reinstall/compile Intel/Nouveau drivers:
    Code:
    mkdir prime
    cd prime
    git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-intel
    cd xf86-video-intel
    ./autogen.sh --prefix=/usr  --enable-dri
    make
    sudo make install
    cd ..
    wget http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/snapshot/xf86-video-nouveau-master.tar.gz
    tar -zxvf xf86-video-nouveau-master.tar.gz
    cd xf86-video-nouveau-master
    ./autogen.sh  --prefix=/usr
    make
    sudo make install
    Reboot in normal mode.

    Code:
    cd prime
    git clone git://anongit.freedesktop.org/git/xorg/util/macros
    git clone --depth 1 git://people.freedesktop.org/~airlied/xrandr -b prime
    wget http://xorg.freedesktop.org/releases/individual/lib/libXrandr-1.4.0.tar.bz2 
    wget http://xorg.freedesktop.org/releases/individual/proto/randrproto-1.4.0.tar.bz2
    tar jxvf libXrandr-1.4.0.tar.bz2 
    tar jxvf randrproto-1.4.0.tar.bz2
    cd macros
    ./autogen.sh --prefix=/opt/xorg 
    sudo make install
    export ACLOCAL="aclocal -I /opt/xorg/share/aclocal"
    export PKG_CONFIG_PATH=/opt/xorg/lib/pkgconfig:/opt/xorg/share/pkgconfig:${PKG_CONFIG_PATH}
    export LD_LIBRARY_PATH=/opt/xorg/lib:${LD_LIBRARY_PATH}
    export LD_RUN_PATH=/opt/xorg/lib:${LD_RUN_PATH}
    cd ..
    cd randrproto-1.4.0
    ./autogen.sh --prefix=/opt/xorg 
    sudo make install
    cd ..
    cd libXrandr-1.4.0
    ./autogen.sh --prefix=/opt/xorg
    make
    sudo make install
    cd ..
    cd xrandr
    ./autogen.sh --prefix=/opt/xorg
    make
    sudo make install
    Thats it, no more building drm, mesa, xserver !
    Now get the provider ids:
    Code:
    /opt/xorg/bin/xrandr --listproviders
    if output shows eg:

    Provider 0: id: 111 cap: b nc: 2 no: 4 nap 1 name:Intel
    Provider 1: id: 68 cap: 5 nc: 2 no: 3 nap 1 name:nouveau

    ... the needed provider ids are 111 and 68.

    Using those provider ids:
    Code:
    /opt/xorg/bin/xrandr --setprovideroffloadsink 68 111
    Now prime is "up". Start an application on the Nvidia GPU using the nouveau driver by prefixing "DRI_PRIME=1" , eg:
    Code:
    DRI_PRIME=1 glxinfo

Page 2 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •