Lenovo IdeaPad Y580

From ArchWiki
Revision as of 04:39, 14 October 2013 by Dopamine (talk | contribs) (Added info for using display manager)
Jump to: navigation, search

Intel graphics

This machine has two video cards, an Intel HD 4000 integrated chip and a discrete Nvidia GTX 660M.

If you only wish to use the Intel chip, for improved battery life, lower temperatures, or less complexity, you can simply install xf86-video-intel and use the Intel driver. This will leave the NVIDIA card disabled, but it will still use power. To completely disable the NVIDIA card, enter the Y580's BIOS and on the "Configuration" tab, change "Graphic Device" from "Switchable Graphic" to "UMA Graphic". If these options are not there, you may need to update the BIOS.

NVIDIA graphics

Since the NVIDIA card must have some form of Optimus to be used, the graphics configuration can be complicated. The current Arch Linux kernel and proprietary NVIDIA driver support Optimus, but configuration is somewhat involved. There are three options:

  • Use the proprietary NVIDIA driver
  • Use the open-source nouveau driver
  • Use Bumblebee, which is designed as a third-party Optimus-like solution

Each option has its advantages. Bumblebee allows power-saving methods like graphics-card switching, so if you don't want to constantly be running the NVIDIA card, follow the guides for Bumblebee on the wiki. The proprietary NVIDIA driver typically has better performance than the open-source driver as of September 2013, but typically has more bugs and compatibility issues. The nouveau driver is reverse-engineered due to Nvidia's lack of hardware documentation, and therefore does not perform as well as the proprietary driver, but is simpler to use and less prone to bugs. More information can be found on the wiki's article on NVIDIA Optimus.

Using nouveau

To use the nouveau drivers, install the xf86-video-nouveau, xf86-video-intel, and xorg-xrandr packages. After rebooting, X should automatically detect the drivers and start. To use the nvidia card, you must first issue xrandr --setprovideroffloadsink nouveau Intel, which specifies offloading of graphical processing to the NVIDIA device. To run a program using the NVIDIA device, you must specify DRI_PRIME=1 before issuing the command, i.e. DRI_PRIME=1 glxgears. To make sure the NVIDIA card is being accessed, install the mesa-demos package and issue DRI_PRIME=1 glxinfo . There should be a line that says OpenGL vendor string: nouveau.

If you don't want to issue xrandr --setprovideroffloadsink nouveau Intel every time you start X, you can add it to the beginning of your ~/.xinitrc. You can also add export DRI_PRIME=1 to your ~/.bashrc if you want to use the NVIDIA device for all programs.

Using nvidia

To use the proprietary NVIDIA drivers, install the xf86-video-modesetting, nvidia, and xorg-xrandr packages.

The next step is to change /etc/X11/xorg.conf appropriately. First, you must determine the PCI address of the NVIDIA card. Using lspci, check the NVIDIA entry:

lspci | grep NVIDIA

The first number you see, which should be formatted something like ##:##.#, is the PCI address. In /etc/X11/xorg.conf, however, the format must be modified so each number is one digit separated by colons (i.e. 01:00.0 would be written as 1:0:0).

Now edit /etc/X11/xorg.conf:

# nano /etc/X11/xorg.conf
Section "ServerLayout"
        Identifier "layout"
        Screen 0 "nvidia"
        Inactive "intel"

Section "Device"
        Identifier "nvidia"
        Driver "nvidia"
        BusID "PCI:PCI_address"

Section "Screen"
        Identifier "nvidia"
        Device "nvidia"
        Option "UseDisplayDevice" "none"

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

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

The final step is to modify your ~/.xinitrc file to run two xrandr commands. Add the following two lines at the beginning of your .xinitrc:

$ nano ~/.xinitrc
xrandr --setprovideroutputsource modesetting NVIDIA-0 &
xrandr --auto &

Now reboot, and X should run using the startx command (assuming you have an appropriate window manager or session specified in ~/.xinitrc). If you get a black screen after starting X, kill it and try starting X again (it may take several tries).

If you use a display manager instead of manually starting X, you will need to specify the xrandr commands in their startup scripts. The wiki page for Xrandr specifies the location of the scripts for GDM and KDM.