Difference between revisions of "HOWTO: Get AMD/ATI or Nvidia Video Cards working in Sabayon"

From Sabayon Wiki
Jump to: navigation, search
m (NVIDIA)
m (TEAM RED - AMD)
 
(103 intermediate revisions by 3 users not shown)
Line 2: Line 2:
  
  
= AMD =
+
{{Warning| '''SUPPORTED AMD HARDWARE'''
 +
FGLRX is currently deprecated. AMDGPU is the new platform. Devices not supported by AMDGPU will be supported by radeon. AMDGPU-PRO is currently only supported on .deb and .rpm distributions.
 +
}}
  
(UPDATED 5.5.13 Thanks to anomaly65) https://forum.sabayon.org/viewtopic.php?f=56&t=28808
+
= <span style="color:BLUE">Kernel Upgrade (optional)</span> =
  
{{Warning| ''' This only covers HD5XXX series and higher. The r600-HD4xxx are on hold due to other portions of system incompatibility. This doesn't cover hybrid (i.e. intel-ati on many new laptops) as I don't have one to test on '''}}
+
==Repository Database Update==
 
+
First things first! Update the database to make sure we have the most up to date package available! This will give us the most recent list of kernels and drivers.
== Prepare ==
 
Lets prepare the system for a fresh install of the ati-drivers package and block the conflicting driver Radeon at boot. be sure to look at the first part of the line. $ is for user while # is for root!
 
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
  
localhost user # equo update --force
+
localhost root # equo update
localhost user # equo remove ati-drivers
 
localhost user # equo remove xf86-video-ati
 
localhost user # equo remove x11-base/xorg-drivers
 
localhost user # equo remove --configfiles xf86-video-ati
 
localhost user # echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf
 
 
</pre>}}
 
</pre>}}
  
If your radeon module is still loaded after boot and you have added it to the modprobe blacklist, look into '''/etc/conf.d/modules''' to see if it is listed in the modules line.
+
== Method 1 (kernel-switcher tool) ==
  
 +
This method should automagically install the corresponding driver updates and addons such as the zfs mod.
  
Now we need to disable KMS (Kernel Mode Setting)
 
  
 +
Lets see what is available!
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost user # nano /etc/default/grub
+
localhost root # kernel-switcher list
 
</pre>}}
 
</pre>}}
  
==Editing /etc/default/grub==
+
Find a kernel you wish to use, and switch!
 +
{{Console| <pre class="clear">
 +
localhost root # kernel-switcher switch linux-sabayon-4.1.7
 +
</pre>}}
  
You will notice a Difference. I have highlighted in Red what needs to be added.
+
== Method 2 (Manual) ==
  
    # Copyright 1999-2012 Gentoo Foundation
+
This method isn't better or worse than kernel-switcher. It just allows you to know exactly whats going on, what you are doing, and what is changing. This method doesn't automagically upgrade drivers or install addons such as virtualbox addons or the zfs mod.
    # Distributed under the terms of the GNU General Public License v2
 
    # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.2 2012/06/28 22:36:53 floppym Exp $
 
    #
 
    # To populate all changes in this file you need to regenerate your
 
    # grub configuration file afterwards:
 
    #    'grub2-mkconfig -o /boot/grub2/grub.cfg'
 
    #
 
    # See the grub info page for documentation on possible variables and
 
    # their associated values.
 
    GRUB_DEFAULT=saved
 
    GRUB_DISTRIBUTOR="Sabayon"
 
   
 
    GRUB_HIDDEN_TIMEOUT=0
 
    GRUB_HIDDEN_TIMEOUT_QUIET=true
 
    GRUB_TIMEOUT=5
 
    GRUB_DISABLE_LINUX_UUID=true
 
   
 
    GRUB_CMDLINE_LINUX_DEFAULT=""
 
    GRUB_CMDLINE_LINUX="<span style="color:red">nomodeset</span>"
 
   
 
    # Uncomment to disable graphical terminal (grub-pc only)
 
    #GRUB_TERMINAL=console
 
   
 
 
 
==Install==
 
 
 
Now install new kernel and drivers.
 
   
 
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost user # equo install sys-kernel/linux-sabayon
+
localhost root # equo install sys-kernel/linux-sabayon
localhost user # equo install sys-kernel/sabayon-sources
+
localhost root # equo install sys-kernel/sabayon-sources
localhost user # equo install x11-drivers/ati-drivers amdcccle
 
 
</pre>}}
 
</pre>}}
  
Line 76: Line 46:
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost user # eselect bzimage list
+
localhost root # eselect bzimage list
localhost user # eselect kernel list
+
localhost root # eselect kernel list
 
</pre>}}
 
</pre>}}
  
Line 84: Line 54:
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost user # eselect bzimage list
+
localhost root # eselect bzimage list
 
Available kernel targets:
 
Available kernel targets:
   [1]  kernel-genkernel-x86_64-3.8.0-sabayon *
+
   [1]  kernel-genkernel-x86_64-3.13.0-sabayon *
   [2]  kernel-genkernel-x86_64-3.9.0-sabayon
+
   [2]  kernel-genkernel-x86_64-4.1.0-sabayon
localhost user # eselect kernel list
+
localhost root # eselect kernel list
 
Available kernel symlink targets:
 
Available kernel symlink targets:
   [1]  linux-3.8.0-sabayon
+
   [1]  linux-3.13.0-sabayon
   [2]  linux-3.9.0-sabayon *
+
   [2]  linux-4.1.0-sabayon *
localhost user #  
+
localhost root #  
 
</pre>}}
 
</pre>}}
  
  
Now select the newer bzimage and kernel and switch to the AMD/ATI libraries.
+
Now select the newer bzimage and kernel.
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost user # eselect bzimage set 2
+
localhost root # eselect bzimage set 2
localhost user # eselect kernel set 2
+
localhost root # eselect kernel set 2
localhost user # eselect opencl set amd
 
localhost user # eselect opengl set ati
 
 
</pre>}}
 
</pre>}}
  
  
Need an updated or new xorg.conf? If you weren't using fglrx before then... yes.
+
<span style="color:RED">Once your new kernel is installed reboot!</span>
Backup old and update.
+
 
 +
==Clean (optional)==
 +
 
 +
Once you have everything working you can remove the old kernel if you like.
 +
<span style="color:red; font-weight=bold;">MAKE SURE YOU SELECT THE CORRECT KERNEL! Look using "equo search linux-sabayon" then copy and paste!</span>
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost user # cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
+
[email protected]localhost ~ $ su
localhost user # /opt/bin/aticonfig --initial
+
localhost root # equo remove sys-kernel/linux-sabayon-3.13.11
 
</pre>}}
 
</pre>}}
  
OK now reboot!
+
= <span style="color:RED">TEAM RED - AMD</span> =
 +
 
 +
=='''FGLRX to Open Source (radeon or AMDGPU)'''==
 +
 
 +
{{Note| '''SED'''
 +
In these instructions you'll notice the sed command. This may make some people leary as not everyone understands this command. "sed" stands for "stream editor". It can edit the edit file for you by substituting lines, words, strings, etc. In this case we are using it to remove a line in blacklist.conf and nomodeset command in grub config files.
  
==Configure==
+
If you don't feel fully comfortable about this command. Back up your file or use nano (vi etc.) to edit the file!
 +
}}
  
Once you login and decide you want to set resolutions and extra settings open amdcccle.
+
 
 +
"Why" you ask? Besides the drivers not quickly supporting new Kernel releases, Open Source drivers are getting better all the time and AMD has announced plans to open source as much as possible. The majority of the drivers will be opensource while proprietary features will remain in a kernel agnostic binary blob. If you want to go full opensource, then the driver will hook into mesa for all rendering etc. If you want proprietary features, the same driver hooks into a binary blob. Same driver, different options. AMDGPU-PRO will basically be a full install of the opensource driver, but with binaries included. Currently AMDGPU-PRO isn't available to Gentoo in this BETA phase.
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
[email protected] ~ $ kdesu /opt/bin/amdcccle
+
 +
localhost root # equo update
 +
localhost root # equo remove ati-drivers ati-userspace amdcccle
 +
localhost root # equo install xf86-video-ati xf86-video-amdgpu
 +
localhost root # eselect opengl set xorg-x11
 +
localhost root # sed -i 's/nomodeset//g' /etc/default/grub
 +
localhost root # sed -i 's/nomodeset//g' /boot/grub/grub.cfg
 +
localhost root # sed -i 's/"blacklist radeon"//g' /etc/modprobe.d/blacklist.conf
 +
localhost root # rm -rf /etc/X11/xorg.conf
 
</pre>}}
 
</pre>}}
  
==Clean (optional)==
+
Newer versions of X11 do not require an xorg.conf file. If any special settings are required or wanted you can apply an override in /etc/X11/xorg.conf.d/
 +
 
 +
{{Console| <pre class="clear">
 +
localhost root # vi /etc/X11/xorg.conf.d/30-Devices.conf
 +
</pre>}}
  
Once you have everything working you can remove the old kernel if you like.
+
Now we can add typical xorg.conf configurations for the devices such as tearfree. This is typically for the more savvy.
<span style="color:red; font-weight=bold;">MAKE SURE YOU SELECT THE CORRECT KERNEL! Look using "equo search linux-sabayon" then copy and paste!</span>
 
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
+
Section "Device"
localhost user # equo remove sys-kernel/linux-sabayon-3.8.10
+
Identifier "Card0"
 +
Driver "amdgpu"
 +
BusID "PCI:1:0:0"
 +
Option "TearFree" "True"
 +
Option "EnablePageFlip" "True"
 +
EndSection
 
</pre>}}
 
</pre>}}
  
  
==Roll Back==
 
  
If you're looking at this. We are either curious or ran into a snag.
 
  
Good News: everything is reversible!
+
== '''AMDGPU w/Display Code *EXPERIMENTAL!*''' ==
  
Bad News: you're stuck in a terminal until its fixed!
 
But you knew that didn't you ;)
 
  
With your computer powered off, connect the computer to the internet via a cable and then press the power button.  
+
So first you'll want to be aware you're going to be adding a couple community repositories for packages. One repository will be using -9999 packages for MESA, LIBDRM, and LLVM.
When you reach the Grub selection screen press an arrow key to halt the timer and go to the kernel you would
+
You'll also want to be aware that you should still keep your current kernel in case anything goes wrong. That will allow you to continue booting into your system from the advanced options in GRUB by selecting the older kernel. This newer kernel and experimental packages will not be supported.
like to boot from. Press 'e' on that line and it will take you to edit the grub commands before booting.
 
<span style="color:red">This is a temporary grub edit, it will revert after reboot!</span>
 
  
At the end of the "linux" line add the option "nox"
+
{{Warning| '''Not all AMD Display Code is not mainline!'''
 +
This contains incomplete code that has yet not been adopted into the mainline kernel. Results may vary and this may not be the same as the finalized versions of code.
 +
}}
  
    linux  /boot/kernel-genkernel-x86_64-3.9.0-sabayon ro  init=/linuxrc splash=silent,theme:sabayon
 
    video=vesafb:ywrap,mtrr:3 vga=791 gfxpayload=1024x768x16 console=tty1 quiet dokeymap keymap=us
 
    domdadm root=UUID=787202b0-a5d2-4e03-aeb6-569bafef6de0 docrypt <span style="color:red">nox</span>
 
  
Now press F10 to boot with the new command.
+
Lets get started with prep work!
 +
{{Console| <pre class="clear">
 +
localhost root # equo update; equo upgrade
 +
localhost root # equo install enman
 +
localhost root # enman add gaming-live
 +
localhost root # enman add community
 +
localhost root # equo update; equo upgrade
 +
localhost root # echo "media-libs/mesa-9999" >> /etc/entropy/packages/package.unmask
 +
localhost root # echo "x11-libs/libdrm-9999" >> /etc/entropy/packages/package.unmask
 +
localhost root # echo "sys-devel/llvm-9999" >> /etc/entropy/packages/package.unmask
 +
localhost root # equo install v86d bison make cmake automake gcc genkernel-next git dev-python/sphinx re2c dev-util/ninja sys-devel/llvm-9999 x11-libs/libdrm-9999 media-libs/mesa-9999
 +
</pre>}}
  
This will take you through the normal boot process, then will put you at a CLI login screen.
 
  
You can either
+
Now lets download a kernel with display code.
# login as root
+
 
# login as user then su
+
{{Console| <pre class="clear">
 +
localhost root # git clone -b amd-staging-drm-next --depth=1 git://people.freedesktop.org/~agd5f/linux   
 +
localhost root # mv linux /usr/src/linux-4.17.0-amdgpu
 +
localhost root # cd /usr/src
 +
localhost root # rm -rf linux
 +
localhost root # ln -s linux-4.17.0-amdgpu/ linux
 +
localhost root # cd linux
 +
</pre>}}
 +
 
  
Now to start putting things back!
+
Now we finish configuring and building the kernel. Now's you chance to make any other config changes you want. If you use lvm add the --lvm flag to the genkernel command.
 +
You can also double check Device Drivers -> Graphics Support -> Display Engine Configuration -> AMD DC is enabled as well as Raven family if you plan on owning an APU based on Raven.
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost user # equo update
+
localhost root # zcat /proc/config.gz > /usr/src/config
localhost user # equo remove ati-drivers amdcccle
+
localhost root # sed -i '5495 a CONFIG_DRM_AMD_DC=y' /usr/src/config
localhost user # equo install xf86-video-ati
+
localhost root # sed -i '5496 a CONFIG_DRM_AMD_DC_DCN1_0=y' /usr/src/config
localhost user # equo install x11-base/xorg-drivers
+
localhost root # genkernel --kernel-config=/usr/src/config --menuconfig --splash=sabayon --luks all
localhost user # eselect opengl set xorg-x11
+
localhost root # grub2-mkconfig -o /boot/grub/grub.cfg
localhost user # sed -i '/blacklist radeon/d' /etc/modprobe.d/blacklist.conf
 
localhost user # sed -i 's/\<nomodeset\>//g' /etc/default/grub
 
localhost user # cp /etc/X11/xorg.conf.bak /etc/X11/xorg.conf
 
 
</pre>}}
 
</pre>}}
  
Now reboot! Now you are back on the Open Source Drivers!
 
You will keep your upgraded kernel so that was not reverted. (reason for less steps)
 
  
{{Note| '''SED'''
+
You can watch the git repo for updates/fixes/changes etc at https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-drm-next to decide if you want to update the kernel again. If you do this, none of the sed commands are necessary for the config as /proc/config.gz will already have the updated config changes.
 +
 
 +
= <span style="color:green">TEAM GREEN - NVIDIA</span> =
 +
 
 +
== Booting live/installer disc with vesa graphics on older GPUs ==
 +
Can't seem to get the GUI on the installer disc and seem stuck at a black screen or terminal? We've got you covered. When selecting an option from the boot screen
 +
edit the boot line and include the following at the end of the line.
 +
 
 +
{{Console| <pre class="clear">modprobe.blacklist=nvidia xdriver=vesa</pre>}}
 +
 
 +
This should get you into the live session to perform an install. Afterwards, you'll need to either switch to Nouveau or a proprietary driver version that supports your card.
 +
 
 +
=='''Proprietary'''==
 +
Sabayon should already come with the latest nvidia-drivers, but if for some reason you don't have correct proprietary Nvidia drivers installed
 +
there are simple steps to follow.
 +
 
 +
=== Prepare if returning from nouveau ===
 +
Because we use the proprietary drivers by default, the opensource driver is usually already blacklisted; but if you switched to the opensource driver and are
 +
returning to the proprietary offerings, you must first blacklist the opensource driver.
 +
 
 +
{{Console| <pre class="clear">localhost root # sed -i s/'#blacklist nouveau'/'blacklist nouveau'/ /etc/modprobe.d/blacklist.conf </pre>}}
  
I'm sure you have noticed the sed command. This may make some people leary as not everyone understands this command. "sed" stands for "stream editor". It can edit the edit file for you by deleting lines, words, strings, etc. In this case we are using it to remove the Line we added in blacklist.conf and the command we added in grub.
+
=== Available driver version ===
  
If you don't feel fully comfortable about this command. Back up your file or use nano (vi etc.) to edit the file!
+
To get a list of all drivers for all kernels that are available:
}}
+
{{Console| <pre class="clear">$ equo search -qv nvidia-drivers</pre>}}
  
= NVIDIA =
+
List of all drivers versions available for currently running kernel:
 +
{{Console| <pre class="clear">$ equo search -qv nvidia-drivers#$(uname -r)</pre>}}
  
== simple procedure ==
+
=== Newest drivers for currently running kernel ===
 +
{{Console| <pre class="clear">localhost root # equo install --ask nvidia-driver#$(uname -r) nvidia-userspace</pre>}}
 +
Will install newest driver available for currently running kernel.
  
If you have issues running X after an upgrade, you can follow this procedure:
+
=== Older drivers for currently running kernel ===
 +
{{Note| '''Not supported or Guaranteed'''
 +
It has been noticed that depending on the old GPU or GPU drivers version, they may or may not work. This seems pretty hit and miss.
 +
Mobile GPUs and non-discrete GPUs (integrated in the motherboard) appear to be affected by this. If you're using an GPU older than
 +
Fermi or an integrated GPU, we recommend using the open source nouveau driver.
 +
}}
  
let's update the package database
+
List Nvidia drivers for your current kernel (insturctions above), and install it along with corresponding '''nvidia-userspace''', e.g.:
 +
{{Console| <pre class="clear">localhost root # equo install --ask nvidia-drivers-340.104#$(uname -r) nvidia-drivers-340.104</pre>}}
  
  > equo update --force
+
now lets switch from opensource opengl libraries to proprietary nvidia opengl libraries
  ...
 
  
 +
{{Console| <pre class="clear">localhost root # eselect opengl set nvidia</pre>}}
  
let's check the current installed kernel
+
=='''Open Source - Switching to Nouveau drivers'''==
  > uname -r
+
If Sabayon is installed you reboot and you find you're stuck at a login terminal or just wan to switch to open source drivers, this is a simple fix.  
  ... (lookup the kernel version, you will need to pick the appropriate driver based on this)
+
Just login with your user you created. Then we'll remove the proprietary drivers and the blacklist for nouveau using the following:
  
let's list the list of nvidia drivers, in a concise way
+
=== Unblock nouveau driver ===
  > equo s nvidia-drivers -q -v
+
Because we use the proprietary drivers by default, the opensource driver is blacklisted. You must first unblock the driver from being loaded.
  ... (list of all nvidia-drivers, you need to pick one which matches the major x.y of your kernel version)
 
  
finally install the appropriate driver for your kernel
+
{{Console| <pre class="clear">localhost root # sed -i s/'blacklist nouveau'/'#blacklist nouveau'/ /etc/modprobe.d/blacklist.conf </pre>}}
  > equo install '''full name of driver you choosed from above list'''  
 
  
It worked for updating the drivers appropriately for a thinkpad t61p, those instructions are expected to be better than outdated ones.
+
You still must block or remove the proprietary driver. Now that both drivers have the ability to load, it will most likely lock up the machine
 +
on boot or cause instability. Both drivers cannot be loaded at the same time.
  
 +
=== Removal of proprietary driver ===
 +
You can blacklist the nvidia drivers OR remove them entirely. Removal is the simplest method.
  
== outdated ==
+
{{Console| <pre class="clear">localhost root # equo update; equo remove nvidia-drivers nvidia-userspace</pre>}}
{{Warning| '''This page is out of date?, misleading and potentially dangerous to your system.  Use equo to install the driver package you need (eg ati-drivers or nvidia-drivers) and kernel-switcher for future updates to your kernel.'''}}
 
  
{{Warning| '''Portage (emerge) is not the primary package manager for Sabayon, this article is for advanced users only. In other words if this fails for you, its your fault. You have been warned.'''}}
+
Now lets make sure we're using the correct opengl libraries
  
# In root shell '''emerge kernelname-sources -pv ''', if already installed go to next step otherwise type '''emerge =kernelname-sources-2.6.kernelversion ''' (kernel version can be identified by typing '''uname -r ''' or '''uname -a ''')
+
{{Console| <pre class="clear">localhost root # eselect opengl set xorg-x11</pre>}}
# If not using genkernel ensure your kernel configuration supports your video card (gentoo-wiki.com has more information)
 
# In root shell type '''emerge nvidia-drivers''' (Most older cards need a version that is 97.00 or lower.  Add >=x11-drivers/nvidia-drivers-97.00 to your /etc/portage/package.mask file before emerging.  i.e.  '''echo \>=x11-drivers/nvidia-drivers-97.00 >> /etc/portage/package.mask''' before you emerge nvidia-drivers'') --[[User:Megaman5|Megaman5]] 01:58, 24 March 2008 (UTC)
 
# Edit etc/X11/xorg.conf and change the Driver option under Device from nv or vesa to nvidia, also ensure the the Load glx line is uncommented in the Module Section
 
# In a root shell type '''eselect opengl set nvidia '''
 
# Make sure your user is in the video group by typing '''gpasswd -a youruser video ''' in a root shell.
 
# Restart X
 
# If X doesn't work please pastebin the contents of /var/log/Xorg.0.log and possibly /etc/X11/xorg.conf and check #Sabayon, the Sabayon Forums or gentoo-wiki.com, If it does, in root shell type glxinfo | grep direct, if this says Yes then continue to next step
 
# Using Google or other means identify whether your card works best with XGL or AIGLX or neither.
 
# Using accel-manager which will need to be emerged by typing (still in a root shell) '''emerge accel-manager''', choose your preferred method XGL or AIGLX. Or if neither ignore this step.
 
# Repeat Step 7
 
# You should now have a working NVIDIA card with DRI and if you choose XGL or AIGLX. If you some reason you don't please use the resources in the Forum Usage & Resources Post in Sabayon Forums to remedy the problem.These resouces include http://gentoo-wiki.com/HOWTO_nVidia_Drivers. It would be beneficial if you repeat Step 8 as part of the troubleshooting process.
 
  
----
+
Now reboot and you'll be using nouveau. If you ever feel like returning to proprietary drivers, you'll need to blacklist nouveau again. then
To Install Nvidia Accelerated drivers (closed blob) for more recent video cards, e.g. 520GT, follow these steps in order:
 
   
 
Firstly, attempt to discover the kernel revision your sabayon install is currently using, you can achieve this by opening an instance of a command line interface or Terminal emulator and type in this instruction into the terminal:
 
uname -a
 
   
 
You should see from the very beginning of the screen (far left of the screen, in the terminal box) your host name which will say: Linux,  and the name you gave your PC, during the installation of sabayon. Next you will see the kernel version and then it's description... which should resemble something like this:
 
[3.2.0-sabayon #1 SMP]
 
   
 
Using this information, use either Sulfur (GUI) or equo (command line) installer and search for the correct revision that suits your graphics card and kernel version that we have just discovered. This case we will want to install the Nvidia 290.xx driver that matches the kernel which is 3.2.0-sabayon #1 SMP
 
   
 
Before we install, we want to make sure that there are no possible driver conflicts
 
   
 
For example: while I was learning this, the ATI fglrx (closed blob for ATI cards) driver was installed, along side nouveau(open sourced nvidia driver), plus the eselect program was pointed to the ATI driver, which did not help matters much...
 
   
 
You can detect if they are installed or not by typing in a root terminal by typing either "su root" (without quotes) followed by your username and pass or "sudo equo" (without quotes) search ATI and repeat the process for nouveau.
 
   
 
If you find either offending package, just type "equo remove ati-drivers" and/or "xf86-video-nouveau" (without quotes)
 
   
 
Once you found the correct version and type of graphic drivers you will ether need to right click on the driver package in Sulfur, then select install or alternatively type in "equo install nvidia-drivers-295.20#3.2.0-sabayon" (without quotes)
 
   
 
This will download, install and compile the modules into the kernel, but you will have to setup the last two bits yourself.
 
   
 
Follow these last two steps to complete the process:
 
Not doing these can cause your system to freeze, lock up and have a blank screen if not completed properly, if you choose to run a game or use your card's accelerated features!
 
   
 
In a root terminal type:
 
eselect opengl set nvidia
 
  
Make sure your user is in the video group by typing "gpasswd -a <username> video" (without quotes, replace <username> with your username e.g. gpassword -a mike video) in a terminal as root.
 
  
 
[[Category:Graphics|Get Ati or Nvidia Video Cards working in Sabayon]]
 
[[Category:Graphics|Get Ati or Nvidia Video Cards working in Sabayon]]

Latest revision as of 03:13, 3 March 2018

i18n: en pl


Stop.png
SUPPORTED AMD HARDWARE

FGLRX is currently deprecated. AMDGPU is the new platform. Devices not supported by AMDGPU will be supported by radeon. AMDGPU-PRO is currently only supported on .deb and .rpm distributions.

Kernel Upgrade (optional)

Repository Database Update

First things first! Update the database to make sure we have the most up to date package available! This will give us the most recent list of kernels and drivers.

[email protected] ~ $ su
localhost root # equo update

Method 1 (kernel-switcher tool)

This method should automagically install the corresponding driver updates and addons such as the zfs mod.


Lets see what is available!

localhost root # kernel-switcher list

Find a kernel you wish to use, and switch!

localhost root # kernel-switcher switch linux-sabayon-4.1.7

Method 2 (Manual)

This method isn't better or worse than kernel-switcher. It just allows you to know exactly whats going on, what you are doing, and what is changing. This method doesn't automagically upgrade drivers or install addons such as virtualbox addons or the zfs mod.

localhost root # equo install sys-kernel/linux-sabayon
localhost root # equo install sys-kernel/sabayon-sources


Now use eselect to set the soft links(shortcuts) to the proper libraries and files. eselect allows us to keep different libraries so we can switch without damaging the system by replacing important files.

First off we need to know which is our new kernel and bzimage

localhost root # eselect bzimage list
localhost root # eselect kernel list


You should get something like this...

localhost root # eselect bzimage list
Available kernel targets:
  [1]   kernel-genkernel-x86_64-3.13.0-sabayon *
  [2]   kernel-genkernel-x86_64-4.1.0-sabayon
localhost root # eselect kernel list
Available kernel symlink targets:
  [1]   linux-3.13.0-sabayon
  [2]   linux-4.1.0-sabayon *
localhost root # 


Now select the newer bzimage and kernel.

localhost root # eselect bzimage set 2
localhost root # eselect kernel set 2


Once your new kernel is installed reboot!

Clean (optional)

Once you have everything working you can remove the old kernel if you like. MAKE SURE YOU SELECT THE CORRECT KERNEL! Look using "equo search linux-sabayon" then copy and paste!

[email protected] ~ $ su
localhost root # equo remove sys-kernel/linux-sabayon-3.13.11

TEAM RED - AMD

FGLRX to Open Source (radeon or AMDGPU)

Question.png
SED

In these instructions you'll notice the sed command. This may make some people leary as not everyone understands this command. "sed" stands for "stream editor". It can edit the edit file for you by substituting lines, words, strings, etc. In this case we are using it to remove a line in blacklist.conf and nomodeset command in grub config files.

If you don't feel fully comfortable about this command. Back up your file or use nano (vi etc.) to edit the file!


"Why" you ask? Besides the drivers not quickly supporting new Kernel releases, Open Source drivers are getting better all the time and AMD has announced plans to open source as much as possible. The majority of the drivers will be opensource while proprietary features will remain in a kernel agnostic binary blob. If you want to go full opensource, then the driver will hook into mesa for all rendering etc. If you want proprietary features, the same driver hooks into a binary blob. Same driver, different options. AMDGPU-PRO will basically be a full install of the opensource driver, but with binaries included. Currently AMDGPU-PRO isn't available to Gentoo in this BETA phase.

[email protected] ~ $ su
localhost root # equo update
localhost root # equo remove ati-drivers ati-userspace amdcccle
localhost root # equo install xf86-video-ati xf86-video-amdgpu
localhost root # eselect opengl set xorg-x11
localhost root # sed -i 's/nomodeset//g' /etc/default/grub
localhost root # sed -i 's/nomodeset//g' /boot/grub/grub.cfg
localhost root # sed -i 's/"blacklist radeon"//g' /etc/modprobe.d/blacklist.conf
localhost root # rm -rf /etc/X11/xorg.conf

Newer versions of X11 do not require an xorg.conf file. If any special settings are required or wanted you can apply an override in /etc/X11/xorg.conf.d/

localhost root # vi /etc/X11/xorg.conf.d/30-Devices.conf

Now we can add typical xorg.conf configurations for the devices such as tearfree. This is typically for the more savvy.

Section "Device"
	Identifier	"Card0"
	Driver		"amdgpu"
	BusID		"PCI:1:0:0"
	Option		"TearFree"		"True"
	Option		"EnablePageFlip"	"True"
EndSection



AMDGPU w/Display Code *EXPERIMENTAL!*

So first you'll want to be aware you're going to be adding a couple community repositories for packages. One repository will be using -9999 packages for MESA, LIBDRM, and LLVM. You'll also want to be aware that you should still keep your current kernel in case anything goes wrong. That will allow you to continue booting into your system from the advanced options in GRUB by selecting the older kernel. This newer kernel and experimental packages will not be supported.

Stop.png
Not all AMD Display Code is not mainline!

This contains incomplete code that has yet not been adopted into the mainline kernel. Results may vary and this may not be the same as the finalized versions of code.


Lets get started with prep work!

localhost root # equo update; equo upgrade
localhost root # equo install enman
localhost root # enman add gaming-live
localhost root # enman add community
localhost root # equo update; equo upgrade
localhost root # echo "media-libs/mesa-9999" >> /etc/entropy/packages/package.unmask
localhost root # echo "x11-libs/libdrm-9999" >> /etc/entropy/packages/package.unmask
localhost root # echo "sys-devel/llvm-9999" >> /etc/entropy/packages/package.unmask
localhost root # equo install v86d bison make cmake automake gcc genkernel-next git dev-python/sphinx re2c dev-util/ninja sys-devel/llvm-9999 x11-libs/libdrm-9999 media-libs/mesa-9999


Now lets download a kernel with display code.

localhost root # git clone -b amd-staging-drm-next --depth=1 git://people.freedesktop.org/~agd5f/linux    
localhost root # mv linux /usr/src/linux-4.17.0-amdgpu
localhost root # cd /usr/src
localhost root # rm -rf linux
localhost root # ln -s linux-4.17.0-amdgpu/ linux
localhost root # cd linux


Now we finish configuring and building the kernel. Now's you chance to make any other config changes you want. If you use lvm add the --lvm flag to the genkernel command. You can also double check Device Drivers -> Graphics Support -> Display Engine Configuration -> AMD DC is enabled as well as Raven family if you plan on owning an APU based on Raven.

localhost root # zcat /proc/config.gz > /usr/src/config
localhost root # sed -i '5495 a CONFIG_DRM_AMD_DC=y' /usr/src/config
localhost root # sed -i '5496 a CONFIG_DRM_AMD_DC_DCN1_0=y' /usr/src/config
localhost root # genkernel --kernel-config=/usr/src/config --menuconfig --splash=sabayon --luks all
localhost root # grub2-mkconfig -o /boot/grub/grub.cfg 


You can watch the git repo for updates/fixes/changes etc at https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-drm-next to decide if you want to update the kernel again. If you do this, none of the sed commands are necessary for the config as /proc/config.gz will already have the updated config changes.

TEAM GREEN - NVIDIA

Booting live/installer disc with vesa graphics on older GPUs

Can't seem to get the GUI on the installer disc and seem stuck at a black screen or terminal? We've got you covered. When selecting an option from the boot screen edit the boot line and include the following at the end of the line.

modprobe.blacklist=nvidia xdriver=vesa

This should get you into the live session to perform an install. Afterwards, you'll need to either switch to Nouveau or a proprietary driver version that supports your card.

Proprietary

Sabayon should already come with the latest nvidia-drivers, but if for some reason you don't have correct proprietary Nvidia drivers installed there are simple steps to follow.

Prepare if returning from nouveau

Because we use the proprietary drivers by default, the opensource driver is usually already blacklisted; but if you switched to the opensource driver and are returning to the proprietary offerings, you must first blacklist the opensource driver.

localhost root # sed -i s/'#blacklist nouveau'/'blacklist nouveau'/ /etc/modprobe.d/blacklist.conf 

Available driver version

To get a list of all drivers for all kernels that are available:

$ equo search -qv nvidia-drivers

List of all drivers versions available for currently running kernel:

$ equo search -qv nvidia-drivers#$(uname -r)

Newest drivers for currently running kernel

localhost root # equo install --ask nvidia-driver#$(uname -r) nvidia-userspace

Will install newest driver available for currently running kernel.

Older drivers for currently running kernel

Question.png
Not supported or Guaranteed

It has been noticed that depending on the old GPU or GPU drivers version, they may or may not work. This seems pretty hit and miss. Mobile GPUs and non-discrete GPUs (integrated in the motherboard) appear to be affected by this. If you're using an GPU older than Fermi or an integrated GPU, we recommend using the open source nouveau driver.

List Nvidia drivers for your current kernel (insturctions above), and install it along with corresponding nvidia-userspace, e.g.:

localhost root # equo install --ask nvidia-drivers-340.104#$(uname -r) nvidia-drivers-340.104

now lets switch from opensource opengl libraries to proprietary nvidia opengl libraries

localhost root # eselect opengl set nvidia

Open Source - Switching to Nouveau drivers

If Sabayon is installed you reboot and you find you're stuck at a login terminal or just wan to switch to open source drivers, this is a simple fix. Just login with your user you created. Then we'll remove the proprietary drivers and the blacklist for nouveau using the following:

Unblock nouveau driver

Because we use the proprietary drivers by default, the opensource driver is blacklisted. You must first unblock the driver from being loaded.

localhost root # sed -i s/'blacklist nouveau'/'#blacklist nouveau'/ /etc/modprobe.d/blacklist.conf 

You still must block or remove the proprietary driver. Now that both drivers have the ability to load, it will most likely lock up the machine on boot or cause instability. Both drivers cannot be loaded at the same time.

Removal of proprietary driver

You can blacklist the nvidia drivers OR remove them entirely. Removal is the simplest method.

localhost root # equo update; equo remove nvidia-drivers nvidia-userspace

Now lets make sure we're using the correct opengl libraries

localhost root # eselect opengl set xorg-x11

Now reboot and you'll be using nouveau. If you ever feel like returning to proprietary drivers, you'll need to blacklist nouveau again. then