Saturday, September 14, 2013

HP Envy 17t-j000 (5) (hybrid graphics)

Note: skip down to 'Update 9/28' for the successful way to get hybrid graphics working.

Today I tried installing  NVIDIA-Linux-x86_64-319.49.run from Nvidia Drivers.  It went all the way through installation without errors (other than a message about not being able to run some preinstall script).  And now I can use 'optirun'.  'optirun glxgears' reports 800 FPS instead of the 60 FPS it was reporting before.

I can't run glxgears without optirun any more.  It says
% glxgears
Xlib:  extension "GLX" missing on display ":0.0".
Error: couldn't get an RGB, Double-buffered visual

Here's what inxi is saying now:

% inxi -Gxx
Graphics:  Card: Intel Haswell Integrated Graphics Controller 
    bus-ID: 00:02.0 
X.Org: 1.13.3 drivers: intel (unloaded: fbdev) FAILED: 
    vesa Resolution: 1920x1080@60.0hz 
GLX Renderer: N/A GLX Version: N/A Direct Rendering: N/A

% optirun inxi -Gxx 
Graphics:  Card: Intel Haswell Integrated Graphics Controller 
    bus-ID: 00:02.0 
X.Org: 1.13.3 drivers: intel (unloaded: fbdev) FAILED: 
    vesa Resolution: 1920x1080@60.0hz 
GLX Renderer: GeForce GT 740M/PCIe/SSE2 GLX Version: 4.3.0 
    NVIDIA 319.49 Direct Rendering: Yes

800 FPS? That seems a little on the slow side... the ATI Radeon HD 6770 on my desktop computer gets over 10,000 FPS.

When I was trying to run the install script (NVIDIA-Linux-x86_64-319.49.run), the first error it gave me was the 'You do not appear to have an NVIDIA GPU supported by the NNN.NN NVIDIA Linux graphics driver'.  Then it gave me a second error to the effect that I couldn't install the driver with X already running.  But when I rebooted in 'text' mode, both of these errors went away.  So, they really mean it about turning off your X server to install the driver, but more importantly, the error message is misleading.  I wonder if when I was trying this a month ago if I ever tried shutting X off, or did I just see the  'You do not appear to have an NVIDIA GPU' error and give up?

I reconfigured the few games I occasionally play on this computer to use 'optirun'.  Everything looks good except for 'pinball', which gets an error like this:
ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'librrfaker.so' from LD_PRELOAD cannot be preloaded: ignored.
Initing SDL

0 joysticks were found.
Couldn't set video mode: Couldn't find matching GLX visual

Looks like totem is an OpenGL application.  So when I just put a DVD in the drive, I guess it's not going to play.  How can I configure totem and other apps that I'm not running from a launcher on the desktop to use optirun?

I thought  vlc might work now with optirun, but no... still just a solid green screen.

 I was getting ready to update all the OpenGL apps in my xscreensaver config file, but looks like there's more to it than that.  Screen saver 'hacks' fail with an error like
superquadrics: root window's visual 0x20 does not support the GLX extension.
But note that 'optirun superquadrics' from the command line works fine.

I tried this:
sudo apt-get install --reinstall xserver-xorg-video-intel 
    libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
to get the Intel OpenGL graphics working again. That worked, but Nvidia graphics went away. I reinstalled the Nvidia driver, which fixed Nvidia but broke Intel again.

The problem is that there are conflicts between the two drivers, particularly the OpenGL library:
Smxi was frequently helpful for getting me back to a known-good configuration with just the Intel driver and OpenGL working.

One more useful resource:  Listing of Installed Components from NVIDIA Accelerated Linux Graphics Driver README and Installation Guide.

Update 9/28:

I tried this again using the xorg-edgers repo as described here and this time everything worked.  I'm not sure what I did different, except maybe installing nvidia-25 and bumblebee at the same time?  Whew.  I put many hours into this, but in the end the solution was pretty simple.  When I was beating my head against a brick wall trying to get it to work with the driver from Nvidia's web site, I kept thinking about this and wondering if the conflicts would go away if I was installing the Intel and Nvidia drivers from the same repo.  Looks like the answer was yes.

The only major feature I still don't have working in Linux is Beats Audio.