Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
scheda video ibrida intel/nvidia
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
oscarandrea
Apprentice
Apprentice


Joined: 27 Nov 2015
Posts: 182
Location: Italy/Cosenza

PostPosted: Fri Sep 25, 2020 4:02 pm    Post subject: scheda video ibrida intel/nvidia Reply with quote

Edit: mi sono accorto di non avere la configurazione del kernel adatta, modifico e aggiorno questo post
Salve, è la prima volta che su gentoo mi ritrovo a configurare una scheda video, come processore ho un i5 5200u (è un notebook) e come scheda video una Nvidia 830m
inizialmente avevo seguito direttamente la wiki senza successo https://wiki.gentoo.org/wiki/NVIDIA/Bumblebee
quindi ho poi provato con questa guida sul forum https://forums.gentoo.org/viewtopic-t-1044954.html
essendo la prima volta che configuro una scheda video potrei aver fatto errori stupidi, comunque il risultato che ne esce fuori è:

Code:
➜  ~ primusrun glxgears
primus: fatal: Bumblebee daemon reported: error: Could not load GPU driver

➜  ~ optirun glxgears 
[  256.384361] [ERROR]Accel/display bridge primus is not installed.
➜  ~ eselect opengl list
!!! Error: Can't load module opengl
exiting




Di seguito file di configurazioni che possono essere utili
/etc/bumblebee/bumblebee.conf
Code:

# 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.
[bumblebeed]
# The secondary Xorg server DISPLAY number
VirtualDisplay=:8
# 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.
KeepUnusedXServer=false
# The name of the Bumbleblee server group name (GID name)
ServerGroup=bumblebee
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
TurnCardOffAtExit=false
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
NoEcoModeOverride=false
# 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)
Driver=nvidia
# Directory with a dummy config file to pass as a -configdir to secondary X
XorgConfDir=/etc/bumblebee/xorg.conf.d
# Xorg binary to run
XorgBinary=Xorg

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


# 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
[driver-nvidia]
KernelDriver=nvidia
PMMethod=auto
LibraryPath=/usr/lib64/opengl/nvidia/lib:/usr/lib32/opengl/nvidia/lib:/usr/lib/opengl/nvidia/lib
XorgModulePath=/usr/lib64/opengl/nvidia/lib,/usr/lib64/opengl/nvidia/extensions,/usr/lib64/xorg/modules/drivers,/usr/lib64/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

[driver-intel]
KernelDriver=i915
PMMethod=auto
XorgConfFile=/etc/bumblebee/xorg.conf.intel


make.conf

Code:

➜  ~ sudo cat /etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
COMMON_FLAGS="-march=native -O2 -pipe"
USE="it pulseaudio  bindist wireless X -accessibility -bluetooth  -qt5 -kde gtk
 mtp gui -ipv6  lm-sensors  lz4 mp3 mp4 mpeg mplayer -systemd  wifi  matroska "
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
MAKEOPTS="-j4"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3"
# NOTE: This stage was built with the bindist Use flag enabled
PORTDIR="/var/db/repos/gentoo"
DISTDIR="/var/cache/distfiles"
PKGDIR="/var/cache/binpkgs"
L10N="it"
LINGUAS="it"
VIDEO_CARDS="intel i965 nvidia"
# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C


nvidia-rmmod
Code:

# Nvidia UVM support

remove nvidia modprobe -r --ignore-remove  nvidia



/etc/init.d/bumblebee
Code:

#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2



PIDFILE="${PIDFILE:-/var/run/bumblebee.pid}"

start() {
   ebegin "Starting BumbleBee Daemon"
      start-stop-daemon -S -p "${PIDFILE}" -x /usr/sbin/bumblebeed -- -D ${BUMBLEBEE_EXTRA_OPTS} --pidfile "${PIDFILE}"
   eend $?
}

stop() {

   ebegin "Stopping BumbleBee Daemon"
      start-stop-daemon -K -p "${PIDFILE}" -R SIGTERM/10
   eend $?
}


Configurazione del kernel:

https://paste.ubuntu.com/p/sJnXxJ2xd5/

Grazie
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30965
Location: here

PostPosted: Fri Sep 25, 2020 4:32 pm    Post subject: Reply with quote

Ora con libglvnd (mi pare che ora questa use flag sia abilitata di default) non e' piu' necessario usare primusrun.
Ho semplicemente aggiunto il file /etc/X11/xorg.conf.d/30-nvidia-prime.conf
Code:
Section "ServerLayout"
      Identifier "layout"
      Option "AllowNVIDIAGPUScreens"
EndSection

a questo punto riavviato se lanci il comando
Code:
$ __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY
_NAME=nvidia glxinfo

dovresti vedere che usa nvidia, se va crei un alias nel tuo .bashrc
Code:
alias prime-run="__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY
_NAME=nvidia"

cosi' puoi lanciare quello che vuoi con un semplice prime-run <comando>
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
oscarandrea
Apprentice
Apprentice


Joined: 27 Nov 2015
Posts: 182
Location: Italy/Cosenza

PostPosted: Fri Sep 25, 2020 4:48 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Ora con libglvnd (mi pare che ora questa use flag sia abilitata di default) non e' piu' necessario usare primusrun.
Ho semplicemente aggiunto il file /etc/X11/xorg.conf.d/30-nvidia-prime.conf
Code:
Section "ServerLayout"
      Identifier "layout"
      Option "AllowNVIDIAGPUScreens"
EndSection

a questo punto riavviato se lanci il comando
Code:
$ __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY
_NAME=nvidia glxinfo

dovresti vedere che usa nvidia, se va crei un alias nel tuo .bashrc
Code:
alias prime-run="__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY
_NAME=nvidia"

cosi' puoi lanciare quello che vuoi con un semplice prime-run <comando>


grazie della riposta, nel frattempo mi sono accorto che non avevo settato il kernel correttamente, così ho aggiunto al un .config funzionante cioè che viene detto qui https://wiki.gentoo.org/wiki/NVidia/nvidia-drivers
forse ho sbagliato e non va bene per la scheda video ibrida? non so fatto sta che si blocca il boot su scritte simili ad: ACPI: PCI Interrupt Link [LNKA] (IRQs etc etc

https://paste.ubuntu.com/p/t2yj2prc9Z/
Back to top
View user's profile Send private message
oscarandrea
Apprentice
Apprentice


Joined: 27 Nov 2015
Posts: 182
Location: Italy/Cosenza

PostPosted: Sat Sep 26, 2020 7:55 am    Post subject: Reply with quote

risolto il problema al kernel ho provato a creare questo file ed a lanciare il comando una volta riavviato ma comunque non funge:
Code:

➜  ~ __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo
name of display: :0.0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  39
  Current serial number in output stream:  40

ma io credo ci sia un problema di fondo più grosso per le seguenti problematiche:
Code:

oscar /home/oscar # eselect opengl list
!!! Error: Can't load module opengl
exiting


quel Error: Can't load module opengl mi preoccupa non capisco il perchè..
comunque se provo primusrun o optirun ottengo questi errori (il demone bumblebee è attivo)
Code:

➜  ~ optirun vlc                             
[   16.788939] [ERROR]Accel/display bridge primus is not installed.
➜  ~ eix primus
[I] x11-misc/primus
     Available versions:  (~)0.2 (~)0.2-r2 {+libglvnd ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  0.2-r2(17:51:36 25/09/2020)(libglvnd ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            https://github.com/amonakov/primus
     Description:         Faster OpenGL offloading for Bumblebee

➜  ~ primusrun vlc
VLC media player 3.0.11.1 Vetinari (revision 3.0.11.1-0-g52483f3ca2)
[000055f361389580] main libvlc: Esecuzione di vlc con l'interfaccia predefinita. Usa 'cvlc' per utilizzare vlc senza interfaccia.
primus: fatal: Bumblebee daemon reported: error: [XORG] (EE) No devices detected.


Quindi in definitiva ho creato tutti i file come riportato nella tua guida, però purtroppo non funziona.
Grazie
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30965
Location: here

PostPosted: Sat Sep 26, 2020 10:39 am    Post subject: Reply with quote

Con la use flag libglvnd e' corretto che non ci sia piu' eselect opengl/opencl visto che ci pensa questa libreria.
Puoi postare l'output di
Code:
$ emerge -pv mesa x11-base/xorg-server x11-drivers/nvidia-drivers
$ xrandr --listproviders
:?:
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
oscarandrea
Apprentice
Apprentice


Joined: 27 Nov 2015
Posts: 182
Location: Italy/Cosenza

PostPosted: Sat Sep 26, 2020 11:20 am    Post subject: Reply with quote

fedeliallalinea wrote:
Con la use flag libglvnd e' corretto che non ci sia piu' eselect opengl/opencl visto che ci pensa questa libreria.
Puoi postare l'output di
Code:
$ emerge -pv mesa x11-base/xorg-server x11-drivers/nvidia-drivers
$ xrandr --listproviders
:?:


Code:
➜  ~ emerge -pv mesa x11-base/xorg-server x11-drivers/nvidia-drivers

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] media-libs/mesa-20.1.7::gentoo  USE="X classic dri3 egl gallium gbm gles2 (libglvnd) llvm lm-sensors zstd -d3d9 -debug -gles1 -opencl -osmesa (-selinux) -test -unwind -vaapi -valgrind -vdpau -vulkan -vulkan-overlay -wayland -xa -xvmc" ABI_X86="(64) -32 (-x32)" VIDEO_CARDS="i965 intel (-freedreno) -i915 -iris (-lima) -nouveau (-panfrost) -r100 -r200 -r300 -r600 -radeon -radeonsi (-vc4) -virgl (-vivante) -vmware" 0 KiB
[ebuild   R    ] x11-base/xorg-server-1.20.8-r1:0/1.20.8::gentoo  USE="elogind (libglvnd) udev xorg -debug -dmx -doc -ipv6 -kdrive -libressl -minimal (-selinux) -static-libs -suid -systemd -unwind -wayland -xcsecurity -xephyr -xnest -xvfb" 0 KiB
[ebuild   R    ] x11-drivers/nvidia-drivers-450.66:0/450::gentoo  USE="X compat driver gtk3 (libglvnd) multilib static-libs tools -kms -uvm -wayland" ABI_X86="32 (64) (-x32)" 0 KiB

Total: 3 packages (3 reinstalls), Size of downloads: 0 KiB
➜  ~ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x46 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 4 outputs: 3 associated providers: 0 name:Intel
➜  ~

grazie della risposta, magari provo a ricontrollare i file di configurazione
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30965
Location: here

PostPosted: Sun Sep 27, 2020 6:11 am    Post subject: Reply with quote

Il problema e' xrandr che dovrebbe farti vedere le due schede grafice, nel mio sistema
Code:
$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x47 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 5 associated providers: 0 name:modesetting
Provider 1: id: 0x23e cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0

Ma ora hai installato e attivato anche bumblebee? Hai creato il file /etc/X11/xorg.conf.d/30-nvidia-prime.conf come detto in precedenza?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
oscarandrea
Apprentice
Apprentice


Joined: 27 Nov 2015
Posts: 182
Location: Italy/Cosenza

PostPosted: Sun Sep 27, 2020 10:20 am    Post subject: Reply with quote

fedeliallalinea wrote:
Il problema e' xrandr che dovrebbe farti vedere le due schede grafice, nel mio sistema
Code:
$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x47 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 5 associated providers: 0 name:modesetting
Provider 1: id: 0x23e cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0

Ma ora hai installato e attivato anche bumblebee? Hai creato il file /etc/X11/xorg.conf.d/30-nvidia-prime.conf come detto in precedenza?

sisi, io inizialmente avevo seguito solo la wiki e non aveva funzionato così ho seguito la tua guida modificando anche dove dicevi tu, per quanto riguarda quello che mi hai chiesto:
Code:

➜  ~ /etc/init.d/bumblebee status
 * status: started
➜  ~ sudo cat /etc/X11/xorg.conf.d/30-nvidia-prime.conf
Password:
Section "ServerLayout"
      Identifier "layout"
      Option "AllowNVIDIAGPUScreens"
EndSection
➜  ~

non so forse tra la wiki e la tua guida ho creato problemi, dovrei riprovare a rifare tutto da 0 ma come mi regolo con i file di configurazione? li elimino ma poi da dove parto nuovamente?
grazie mille per l'aiuto, se non dovesse andare comunque non è una tragedia continuo ad usare la scheda intel
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) 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