Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
problems setting up hybrid graphics
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Fri Nov 21, 2014 6:21 pm    Post subject: problems setting up hybrid graphics Reply with quote

I'm using a lenovo b5400 with:
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M/820M / GT 620M/625M/630M/720M] (rev a1)

I have successfully setyp the intel drivers and can start xfce
I have been trying to setup the hybrid graphic rendering to use nvidia's opengl and opencl, I have been using this document:
http://wiki.gentoo.org/wiki/NVIDIA_Driver_with_Optimus_Laptops
and
http://us.download.nvidia.com/XFree86/Linux-x86_64/331.38/README/randr14.html

I've tried both xorg.conf files, created the .xinitrc but all I get is a black screen, with and without slim(startx manually)
I've installed the nvidia-drivers package; I get this error all the time though:
ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
don't know if this is related

thanks
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Fri Nov 21, 2014 6:23 pm    Post subject: Reply with quote

here's my /home/adel/.xinitrc:
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

my first xorg.conf:
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection

Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
Identifier "intel"
Driver "modesetting"
EndSection

Section "Screen"
Identifier "intel"
Device "intel"
EndSection


the second one:
http://pastebin.com/zET9E0HY
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Sat Nov 22, 2014 7:43 am    Post subject: Reply with quote

I also tried this xorg.conf out
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection

Section "Screen"
Identifier "nvidia"
Device "nvidia"
# Uncomment this line if your computer has no display devices connected to
# the NVIDIA GPU. Leave it commented if you have display devices
# connected to the NVIDIA GPU that you would like to use.
Option "UseDisplayDevice" "none"
EndSection

Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0:2:0"
EndSection

Section "Screen"
Identifier "intel"
Device "intel"
EndSection

but no dice
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Sat Nov 22, 2014 4:31 pm    Post subject: Reply with quote

help anyone?
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Sun Nov 23, 2014 7:28 am    Post subject: Reply with quote

I'm giving up this method, ill be relying on switcheroo and bumblebee

bumblebee is great, I got 1200 FPs on glx gears instead of 60, I cannot run wine games however; says 32 bit opengl is not installed
I've also tried out nouveau, I'm getting 6k fps at the cost of not seeing the gears themselves :D, I'm working on it at the moment

I'll try nouveau first and then go back to bumble bee

I still need all the help I can get
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Sun Nov 23, 2014 8:48 am    Post subject: Reply with quote

I have fixed nouveau rendering by enabling compositing, I'm getting 1500 FPS now, games are running with degraded performance!!!!!
I'll try getting back to nvidia-drivers
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Thu Nov 27, 2014 5:27 am    Post subject: Reply with quote

help anyone?
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2284
Location: Adendorf, Germany

PostPosted: Thu Nov 27, 2014 6:00 am    Post subject: Reply with quote

nouveau can not handle 3D acceleration on new(er) cards and falls back to software rendering. Although I guess that your card should be supported.

However, the proprietary driver is much more painless with hybrid laptops.

If you use bumblebee, then try primusrun, too. (x11-misc/primus from the bumblebee overlay)

On my system with nvidia K2100M (quatro) I get:
Code:
 ~ $ optirun glxspheres64
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
Visual ID of window: 0x20
Context is Direct
OpenGL Renderer: Quadro K2100M/PCIe/SSE2
276.954538 frames/sec - 309.081264 Mpixels/sec
282.511501 frames/sec - 315.282835 Mpixels/sec
277.820893 frames/sec - 310.048117 Mpixels/sec
 ~ $ primusrun glxspheres64
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
Visual ID of window: 0x20
Context is Direct
OpenGL Renderer: Quadro K2100M/PCIe/SSE2
392.034528 frames/sec - 437.510533 Mpixels/sec
406.329255 frames/sec - 453.463449 Mpixels/sec
399.765486 frames/sec - 446.138282 Mpixels/sec
As this is a laptop, I am using the nvidia card only for wine applications, steam apps and vmware workstation when on AC power.

But: If you use primusrun and your application/game uses VBLANK, then primus shouldn't blank, too. In that case (highly degraded performance is an indicator) you should start your game with:
Code:
 $ vblank_mode=0 primusrun <your game here>
I had this with Mass Effect 1. Only ~10 FPS with nvidia and ~40FPS with intel. Now I am on ~60 FPS with nvidia. (Full screen 1920x1080, full details, full effects, anisoptric filtering enabled)
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Thu Nov 27, 2014 10:06 am    Post subject: Reply with quote

thanks, I've tried primus application;
primus can indeed run wine games but here's the problem:
$primusrun glxspheres64
Polygons in scene: 62464
Visual ID of window: 0x20
Context is Direct
OpenGL Renderer: GeForce GT 720M/PCIe/SSE2
62.419087 frames/sec - 53.947569 Mpixels/sec
60.007769 frames/sec - 51.863514 Mpixels/sec

$optirun glxspheres64
Polygons in scene: 62464
Visual ID of window: 0x20
Context is Direct
OpenGL Renderer: GeForce GT 720M/PCIe/SSE2
138.040458 frames/sec - 119.305607 Mpixels/sec


the same applies for game fps
did you have this problem too
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2284
Location: Adendorf, Germany

PostPosted: Thu Nov 27, 2014 10:35 am    Post subject: Reply with quote

No... That's weird. Are you running compiz?

Maybe some of the ideas here can help: Worse performance with nvidia gpu than with integrated intel.

Basically I used the archi linux guide on bumblebee to set up things and went the virtualgl way.

Oh, and I am using only the live ebuilds from the bumblebee overlay:
Code:
 # eix --installed-from-overlay bumblebee
[I] sys-power/bbswitch
     Available versions:  0.7 0.8 (**)9999[1] {KERNEL="linux"}
     Installed versions:  9999[1](13:15:57 19.11.2014)(KERNEL="linux")
     Homepage:            https://github.com/Bumblebee-Project/bbswitch
     Description:         Toggle discrete NVIDIA Optimus graphics card

[I] x11-misc/bumblebee
     Available versions:  3.2.1 (**)9999[1] {+bbswitch VIDEO_CARDS="nouveau nvidia"}
     Installed versions:  9999[1](09:26:13 18.11.2014)(bbswitch VIDEO_CARDS="nvidia -nouveau")
     Homepage:            http://bumblebee-project.org https://github.com/Bumblebee-Project/Bumblebee
     Description:         Service providing elegant and stable means of managing Optimus graphics chipsets

[I] x11-misc/virtualgl
     Available versions:  2.3.3 **9999[1] (**)9999-r1[1] {ssl ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  9999-r1[1](08:45:52 24.11.2014)(ssl ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
     Homepage:            http://www.virtualgl.org/
     Description:         Run OpenGL applications remotely with full 3D hardware acceleration

[I] x11-misc/primus [1]
     Available versions:  (**)9999 {ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  9999(09:26:32 18.11.2014)(ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
     Homepage:            https://github.com/amonakov/primus
     Description:         Faster OpenGL offloading for Bumblebee

[1] "bumblebee" /var/lib/layman/bumblebee

_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Thu Nov 27, 2014 1:10 pm    Post subject: Reply with quote

Ok I unmerged my original bumblebee in favour of the layman one
the guide helped a little
I was looking at nvidia-config with optirun vs primusrun
optirun gpu utilization is 70%~ while the primusrun gpu utilization is 25%

at least that gives me a hint on where to look

I appreciate your help, any further help would be even greater
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Sun Nov 30, 2014 6:05 am    Post subject: Reply with quote

I still have no idea why primus run cannot utilize the GPU, help anyone?
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2284
Location: Adendorf, Germany

PostPosted: Mon Dec 01, 2014 9:50 am    Post subject: Reply with quote

blakdeath wrote:
I still have no idea why primus run cannot utilize the GPU, help anyone?
It does utilize it or it would not work at all. My bet is a vblank conflict. Both primus and the application wait for vertical blank. Try with "vblank_mode=0" and with deactivated vertical blank in your application. And maybe take a look into driconf.
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Tue Dec 02, 2014 6:31 pm    Post subject: Reply with quote

now I get nothing when I run optirun glxgears:
adel@localhost ~ $ optirun -v glxgears
[ 56.338490] [INFO]Configured driver: nvidia
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Dec 02, 2014 8:30 pm    Post subject: Reply with quote

Try the following:
Code:
LIBGL_ALWAYS_SOFTWARE=1 glxgears

That shows how fast glxgears runs when your driver setup is broken, as software rendering ignores vsync. You can compare other things to that to know when it's working right.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2284
Location: Adendorf, Germany

PostPosted: Fri Dec 05, 2014 7:54 am    Post subject: Reply with quote

I just had a weird experience.

As I wrote, the performance in Mass Effect 1 was abysmal until I started with vblank_mode=0. Yesterday I tried a game and the performance was down the drain again. It appears that primusrun ignored the vblank setting, or something else enforced a vsync. I had to disable vsync in Mass Effect to get to the old performance.

There is either something wrong with my setup, but I didn't really change anything, or something in the bumblebee/primusrun/wine path is enforcing "outside" vertical sync no matter what.
I haven't figured out, yet, what it is.
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Fri Dec 05, 2014 5:22 pm    Post subject: Reply with quote

here's what I'm getting at the moment:

optirun -vvv glxgears
[ 25.785642] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[ 25.786150] [INFO]Configured driver: nvidia
[ 25.786359] [DEBUG]optirun version 3.2.1 starting...
[ 25.786385] [DEBUG]Active configuration:
[ 25.786402] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[ 25.786421] [DEBUG] X display: :8
[ 25.786439] [DEBUG] LD_LIBRARY_PATH: /usr/lib64/opengl/nvidia/lib:/usr/lib32/opengl/nvidia/lib:/usr/lib/opengl/nvidia/lib
[ 25.786460] [DEBUG] Socket path: /var/run/bumblebee.socket
[ 25.786478] [DEBUG] Accel/display bridge: auto
[ 25.786496] [DEBUG] VGL Compression: proxy
[ 25.786514] [DEBUG] VGLrun extra options:
[ 25.786532] [DEBUG] Primus LD Path: /usr/lib/primus:/usr/lib32/primus
[ 25.786623] [DEBUG]Using auto-detected bridge virtualgl
[ 25.980201] [INFO]Response: No - error: [XORG] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0:0. Please

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

[ 25.980218] [DEBUG]Socket closed.
[ 25.980229] [ERROR]Aborting because fallback start is disabled.
[ 25.980233] [DEBUG]Killing all remaining processes.
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Sat Dec 06, 2014 6:19 am    Post subject: Reply with quote

journalctl entry:
Dec 06 08:18:45 localhost kernel: vgaarb: this pci device is not a vga device
Dec 06 08:18:45 localhost kernel: nvidia 0000:01:00.0: irq 48 for MSI/MSI-X
Dec 06 08:18:45 localhost kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
Dec 06 08:18:45 localhost kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
Dec 06 08:18:45 localhost kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
Dec 06 08:18:45 localhost kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
Dec 06 08:18:45 localhost kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
Dec 06 08:18:45 localhost kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
Dec 06 08:18:45 localhost kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
Dec 06 08:18:45 localhost kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
Dec 06 08:18:45 localhost kernel: ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20140424/nsarguments-95)
Dec 06 08:18:45 localhost kernel: NVRM: RmInitAdapter failed! (0x25:0x28:1193)
Dec 06 08:18:45 localhost kernel: NVRM: rm_init_adapter failed for device bearing minor number 0
Dec 06 08:18:45 localhost kernel: NVRM: nvidia_frontend_open: minor 0, module->open() failed, error -5
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470592] [ERROR][XORG] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0:0. Please
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470604] [ERROR][XORG] (EE) NVIDIA(GPU-0): check your system's kernel log for additional error
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470607] [ERROR][XORG] (EE) NVIDIA(GPU-0): messages and refer to Chapter 8: Common Problems in the
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470611] [ERROR][XORG] (EE) NVIDIA(GPU-0): README for additional information.
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470614] [ERROR][XORG] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA graphics device!
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470618] [ERROR][XORG] (EE) NVIDIA(0): Failing initialization of X screen 0
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470621] [ERROR][XORG] (EE) Screen(s) found, but none have a usable configuration.
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470625] [ERROR][XORG] (EE)
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470628] [ERROR][XORG] (EE) no screens found(EE)
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470632] [ERROR][XORG] (EE)
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470636] [ERROR][XORG] (EE) Please also check the log file at "/var/log/Xorg.8.log" for additional information.
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470639] [ERROR][XORG] (EE)
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470644] [ERROR][XORG] (EE) Server terminated with error (1). Closing log file.
Dec 06 08:18:45 localhost bumblebeed[1471]: [ 2764.470647] [ERROR]X did not start properly


xorg.log: http://pastebin.com/h0Ny5aWf
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Sat Dec 06, 2014 10:29 am    Post subject: Reply with quote

sometimes I get this error in journalctl:
Dec 06 12:25:22 localhost systemd-udevd[1036]: worker [1051] /devices/pci0000:00/0000:00:01.0/0000:01:00.0 timeout; kill it
Dec 06 12:25:22 localhost systemd-udevd[1036]: seq 1083 '/devices/pci0000:00/0000:00:01.0/0000:01:00.0' killed
Dec 06 12:25:26 localhost kernel: bbswitch: enabling discrete graphics
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2284
Location: Adendorf, Germany

PostPosted: Mon Dec 08, 2014 8:06 am    Post subject: Reply with quote

Huh? I got this too before I set my laptop to unload nvidia_nvu module before going to sleep. Do you hibernate your machine? removing the nvidia module and re-inserting it should fix that issue.

Oh, and I prefer glxspheres64 (comes with virtualgl) over glxgears.
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1523

PostPosted: Thu Dec 11, 2014 1:04 pm    Post subject: Reply with quote

you're right, removing and reinserting the moddule helped, now back to debugging the primus run performance
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum