NVidia Optimus on newer notebooks

Discussion in 'Mac and Linux' started by DeathByDenim, July 3, 2013.

  1. sechastain

    sechastain Member

    Messages:
    84
    Likes Received:
    22
    I've been putting it in the last line of the CoherentUI_Host file, when I've been experimenting, e.g.

    exec -a "$0" "$HOST_DIR/CoherentUI_Host.bin" --enable-webgl --ignore-gpu-blacklist "$@"

    I've also tried swapping out exec for primusrun (and vblank_mode=0 primusrun)

    Nothing I've tried has worked so far.
    DeathByDenim likes this.
  2. sechastain

    sechastain Member

    Messages:
    84
    Likes Received:
    22
    Attached are copies of chrome://gpu from different launches of chromium-browser.

    Looks like the most significant change comes from: primusrun chromium-browser --disable-gpu-blacklist
  3. Gwmngilfen

    Gwmngilfen New Member

    Messages:
    9
    Likes Received:
    0
    I'm running a Dell L702x which has a GeForce GT 555M/635M and an Intel i915-compat onboard. I'm using Archlinux, with Bumblebee / Primus / Nvdia at these versions:

    nvidia 325.15-5
    bumblebee 3.2.1-3
    primus 20130815-1

    PA seems to start fine (once the curl [FS#1864] and libudev [FS#1275] bugs were dealt with) using primusrun. There's a variety of small glitches with redrawing the screen (specifically that the UI doesn't seem to redraw until I mouse over a new element). However, I don't ever get a black screen - the game is quite playable.

    I realise this isn't directly helpful to either @DeathByDenim or @sechastain, but in the interests of more data points, I thought I'd post...
  4. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Oh, that's pretty neat. I'm confused about your drivers though. The latest 64-bit Linux drivers I can find on the Nvidia website are 319.49 (even for your model). Are you sure it's 325.15 for you?

    Edit: Oh, those are beta drivers. Hmm, maybe I should try installing those.
  5. Gwmngilfen

    Gwmngilfen New Member

    Messages:
    9
    Likes Received:
    0
    Full package details are here: archlinux.org / packages / extra / x86_64 / nvidia (apparently I can't post links as a new user, so I've removed the protocol and split up the slashes)

    I'm not surprised to hear they're beta drivers. Arch tends to be like that ;)
  6. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Nvidia publish drivers on FTP first:
    ftp://download.nvidia.com/XFree86/Linux-x86_64/325.15/
    DeathByDenim likes this.
  7. Gwmngilfen

    Gwmngilfen New Member

    Messages:
    9
    Likes Received:
    0
    An interesting thing occurred.... so far I've been running PA directly from my Steam folder (primusrun ./PA). Today I tried to run it from Steam - and got a black screen with sound only. Something Steam is doing is causing a problem - @DeathByDenim are you running it directly or through Steam?
  8. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    No, directly. I don't have Steam installed at all.
  9. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Well, I managed to get the 325.15 drivers installed, but neither optirun nor primusrun work sadly. Optirun still crashes with
    Code:
    X Error of failed request:  GLXUnsupportedPrivateRequest
      Major opcode of failed request:  153 (GLX)
      Minor opcode of failed request:  16 (X_GLXVendorPrivate)
      Serial number of failed request:  37
      Current serial number in output stream:  37
    
    And primusrun just gives me a black screen. Though audio works and it reacts to me clicking on (invisible) buttons. Maybe I should just install Arch. :)
  10. Gwmngilfen

    Gwmngilfen New Member

    Messages:
    9
    Likes Received:
    0
    Well, it would be interesting to know if it works for you on Arch - or maybe it's my choice of window manager (XMonad) :p
  11. eeyrjmr

    eeyrjmr Member

    Messages:
    137
    Likes Received:
    13
    Anyone tried Primus instead of optirum (from bumblebee)
  12. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Isn't that what primusrun does?
  13. sechastain

    sechastain Member

    Messages:
    84
    Likes Received:
    22
    Upgrading to 13.04, upgrading my nvidia driver, and updating PA seems to have enabled primusrun+PA to interoperate correctly.

    Woohoo!!
  14. dtbaker

    dtbaker New Member

    Messages:
    9
    Likes Received:
    1
    Hey kids. I am having some success with optirun and PA on Linux.

    While I'm waiting for my first game to load (taking a while??) I'll write up here what I did.

    rename "host/CoherentUI_Host" to "host/CoherentUI_Host_real"

    create a new "host/CoherentUI_Host" file with this inside it:

    #!/bin/bash
    echo "Running optirun ./CoherentUI_Host_real with arguments $@ ";
    optirun ./CoherentUI_Host_real $@

    launch ./PA normally without optirun

    edit: ah actually, doesn't work too well. I'll keep playing and report back!
    it doesn't seem to be running PA on the bumblebee X server.
    if I run "optirun glxgears" and then kill the bumblebee X server process then glxgears will stop, however if I run "optirun ./PA" and then kill the bumblebee X server process then PA will continue to run, so it's clear that PA is not using optirun for some reason
    Last edited: September 29, 2013
  15. dtbaker

    dtbaker New Member

    Messages:
    9
    Likes Received:
    1
    I changed the media/ui/alpha/start/start.html file to redirect to an online WebGL demo page

    This displayed ok when launching ./PA, however the quality was horrible (with or without optirun) compared to running it through chromium

    Any more ideas why optirun might not be working well for this?
  16. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    This is quite strange, can be make screenshots of "horrible"?

    I'm just tested those WebGL demos in Coherent:
    http://ro.me/
    http://patapom.com/topics/WebGL/cathedral/index.html
    Both working just fine.

    I'm also tested Emscripten demo:
    https://github.com/kripken/BananaBread/
    And it's also work smooth.
  17. dtbaker

    dtbaker New Member

    Messages:
    9
    Likes Received:
    1
    Hey thanks for the reply! Here's some more information:

    Running in chromium with optirun:

    optirun chromium-browser --ignore-gpu-blacklist --disable-gpu-sandbox

    Process List:
    Code:
     
    24842 ?        Ss     0:00 /usr/sbin/bumblebeed --use-syslog --driver nvidia --driver-module nvidia-325 --ldpath /usr/lib/nvidia-325:/usr/lib32/nvidia-325 --module-path /usr/lib/nvidia-325/xorg,/usr/lib
     3848 ?        Ss     0:01  \_ Xorg :8 -config /etc/bumblebee/xorg.conf.nvidia -configdir /etc/bumblebee/xorg.conf.d -sharevts -nolisten tcp -noreset -verbose 3 -isolateDevice PCI:01:00:0 -modulepath /u
    
    
    3847 pts/7    S+    0:00       optirun chromium-browser --ignore-gpu-blacklist --disable-gpu-sandbox 
    3849 pts/7    Sl+    0:19          \_ chromium-browser --ignore-gpu-blacklist --disable-gpu-sandbox            
    3862 pts/7    S+    0:00              \_ chromium-browser --ignore-gpu-blacklist --disable-gpu-sandbox 
    3863 pts/7    S+    0:00              \_ /usr/lib/chromium-browser/chromium-browser-sandbox /usr/lib/chromium-browser/chromium-browser --type=zygote
    3864 pts/7    S+    0:00              |  \_ chromium-browser --type=zygote                         
    3868 pts/7    S+    0:00              |      \_ chromium-browser --type=zygote                         
    3896 pts/7    Sl+    0:08              |          \_ /usr/lib/chromium-browser/chro                         
    3928 pts/7    Sl+    0:00              |          \_ /usr/lib/chromium-browser/chro                         
    3950 pts/7    Sl+    1:10              |          \_ /usr/lib/chromium-browser/chro                         
    3958 pts/7    Sl+    0:00              |          \_ /usr/lib/chromium-browser/chro                         
    3914 pts/7    Rl+    1:02              \_ chromium-browser --type=gpu-process --channel=3849.1.639297178 --disable-gpu-sandbox --disable-breakpad --supports-dual-gpus=false --gpu-driver-bug-workarounds
    The online quake3 demo runs ok and reports 60 fps in the top left corner.

    chrome://gpu reports:
    • Canvas: Hardware accelerated
    • Compositing: Hardware accelerated
    • 3D CSS: Hardware accelerated
    • CSS Animation: Accelerated
    • WebGL: Hardware accelerated
    • WebGL multisampling: Hardware accelerated
    • Flash 3D: Hardware accelerated
    • Flash Stage3D: Hardware accelerated
    • Flash Stage3D Baseline profile: Hardware accelerated
    • Texture Sharing: Hardware accelerated
    • Video Decode: Hardware accelerated
    • Video: Hardware accelerated
    • Panel Fitting: Unavailable. Hardware acceleration disabled.
    • Rasterization: Software only. Hardware acceleration disabled.
    Chrome versionChrome/28.0.1500.71
    Operating systemLinux 3.8.0-19-generic
    Optimustrue
    AMD switchablefalse
    Driver vendorNVIDIA
    Driver version325.15
    GL version4.3
    GL_VENDORNVIDIA Corporation
    GL_RENDERERGeForce GT 555M/PCIe/SSE2
    GL_VERSION4.3.0 NVIDIA 325.15

    Running in PA under CoherentUI_Host.bin with an attempt at optirun:

    Replaced exec -a "$0" "$HOST_DIR/CoherentUI_Host.bin" "$@" with optirun $HOST_DIR/CoherentUI_Host.bin $@ --ignore-gpu-blacklist --disable-gpu-sandbox in the script host/CoherentUI_Host

    Launched ./PA without optirun, process list:

    Code:
    24842 ?        Ss     0:00 /usr/sbin/bumblebeed --use-syslog --driver nvidia --driver-module nvidia-325 --ldpath /usr/lib/nvidia-325:/usr/lib32/nvidia-325 --module-path /usr/lib/nvidia-325/xorg,/usr/lib/xorg/module
     4358 ?        Ss     0:00  \_ Xorg :8 -config /etc/bumblebee/xorg.conf.nvidia -configdir /etc/bumblebee/xorg.conf.d -sharevts -nolisten tcp -noreset -verbose 3 -isolateDevice PCI:01:00:0 -modulepath /usr/lib/nvidi
    
    
     1055 pts/4    Ss    0:00  \_ bash
    4338 pts/4    Sl+    0:02  |  \_ ./PA
    4340 pts/4    S+    0:00  |      \_ /bin/bash /home/dtbaker/software/PA/host/CoherentUI_Host --coherent-options=host-e02fac9f-7c6d-42d8-90b4-5b7d001de72c
    4346 pts/4    S+    0:00  |          \_ optirun /home/dtbaker/software/PA/host/CoherentUI_Host.bin --coherent-options=host-e02fac9f-7c6d-42d8-90b4-5b7d001de72c --ignore-gpu-blacklist --disable-gpu-sandbox
    4533 pts/4    Sl+    0:00  |              \_ /home/dtbaker/software/PA/host/CoherentUI_Host.bin --coherent-options=host-e02fac9f-7c6d-42d8-90b4-5b7d001de72c --ignore-gpu-blacklist --disable-gpu-sandbox
    4546 pts/4    S+    0:00  |                  \_ /home/dtbaker/software/PA/host/CoherentUI_Host.bin --coherent-options=host-e02fac9f-7c6d-42d8-90b4-5b7d001de72c --ignore-gpu-blacklist --disable-gpu-sandbox
    4547 pts/4    S+    0:00  |                  \_ /home/dtbaker/software/PA/host/CoherentUI_Host.bin --type=zygote           
    4575 pts/4    Sl+    0:02  |                  |  \_ /home/dtbaker/software/PA/host/CoherentUI_Host.bin --type=renderer        --type=renderer
    4580 pts/4    Sl+    0:00  |                  |  \_ /home/dtbaker/software/PA/host/CoherentUI_Host.bin --type=renderer        --type=renderer
    4585 pts/4    Sl+    0:00  |                  |  \_ /home/dtbaker/software/PA/host/CoherentUI_Host.bin --type=renderer        --type=renderer
    4588 pts/4    Sl+    0:00  |                  |  \_ /home/dtbaker/software/PA/host/CoherentUI_Host.bin --type=renderer        --type=renderer
    4568 pts/4    Rl+    0:01  |                  \_ /home/dtbaker/software/PA/host/CoherentUI_Host.bin --type=gpu-process              --type=gpu-process            --type=gpu-process 
    The online quake3 demo (loaded by modifying media/ui/alpha/start/start.html to redirect there) takes a while to load and maxes out at 7 FPS as reported in the top left corner. Also my Xorg process # 1857 goes through the roof! This makes me believe that my onboard graphics chip is handling graphics under the original Xorg process rather than the new nvidia accelerated Xorg process # 4358

    I couldn't find a way to load "chrome://gpu" within CoherentUI_Host.bin - it must be a chromium thing. I'm not sure how similar CoherentUI is to Chromium.

    Cheers,
    Dave
    DeathByDenim likes this.
  18. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    As long as I understand if Coherent_Host using Nvidia graphics card you should see that it's using those devices:
    Code:
    /dev/nvidia0
    /dev/nvidiactl
    At least it's was like that when I configured Apparmor profile for Chromium few years ago.

    You can easily monitor this activity using many tools available on Linux, or if you on Ubuntu use same apparmor tools:
    https://help.ubuntu.com/community/AppArmor
  19. dtbaker

    dtbaker New Member

    Messages:
    9
    Likes Received:
    1
  20. mike545

    mike545 New Member

    Messages:
    5
    Likes Received:
    0
    Hi,

    What did you do exactly to get that result ?

Share This Page