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

From Sabayon Wiki
Jump to: navigation, search
m
m (Undo revision 23724 by Darksurf (talk))
 
(36 intermediate revisions by 2 users not shown)
Line 3: Line 3:
  
 
{{Warning| '''SUPPORTED AMD HARDWARE'''
 
{{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.  
FGLRX only covers HD5XXX series and higher. The r600-HD4xxx require Open Source Drivers. This guide doesn't cover hybrid (i.e. intel-ati on many new laptops) as I don't have one to test on.
+
 
}}
 
}}
 
  
 
= <span style="color:BLUE">Kernel Upgrade (optional)</span> =
 
= <span style="color:BLUE">Kernel Upgrade (optional)</span> =
 +
 +
==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.
 +
 +
{{Console| <pre class="clear">
 +
 +
localhost root # equo update
 +
</pre>}}
  
 
== Method 1 (kernel-switcher tool) ==
 
== Method 1 (kernel-switcher tool) ==
Line 22: Line 28:
 
Find a kernel you wish to use, and switch!
 
Find a kernel you wish to use, and switch!
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost root # kernel-switcher switch linux-sabayon-3.14.6-r1
+
localhost root # kernel-switcher switch linux-sabayon-4.1.7
 
</pre>}}
 
</pre>}}
 
  
 
== Method 2 (Manual) ==
 
== Method 2 (Manual) ==
Line 52: Line 57:
 
Available kernel targets:
 
Available kernel targets:
 
   [1]  kernel-genkernel-x86_64-3.13.0-sabayon *
 
   [1]  kernel-genkernel-x86_64-3.13.0-sabayon *
   [2]  kernel-genkernel-x86_64-3.14.0-sabayon
+
   [2]  kernel-genkernel-x86_64-4.1.0-sabayon
 
localhost root # eselect kernel list
 
localhost root # eselect kernel list
 
Available kernel symlink targets:
 
Available kernel symlink targets:
 
   [1]  linux-3.13.0-sabayon
 
   [1]  linux-3.13.0-sabayon
   [2]  linux-3.14.0-sabayon *
+
   [2]  linux-4.1.0-sabayon *
 
localhost root #  
 
localhost root #  
 
</pre>}}
 
</pre>}}
Line 71: Line 76:
 
<span style="color:RED">Once your new kernel is installed reboot!</span>
 
<span style="color:RED">Once your new kernel is installed reboot!</span>
  
 +
==Clean (optional)==
  
 
+
Once you have everything working you can remove the old kernel if you like.
= <span style="color:green">AMD - New Sabayon install w/FGLRX</span> =
+
<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>
 
+
Upon booting your Live Disc, you will notice a GRUB screen that varies based on UEFI and NON-UEFI.
+
 
+
- UEFI -
+
      Select "Advanced Options"
+
      Select "Disable Kernel Mode Settings (for AMD Radeon GPUs with FGRLX)"
+
      Boot Live Disc
+
 
+
- NON-UEFI -
+
      Press F5 for "Other Options"
+
      Select "nomodeset"
+
      Boot Live Disc
+
 
+
 
+
= <span style="color:green">AMD APU + AMD PCI-E Graphics</span> =
+
 
+
Found a hiccup with graphics detections and Sabayon installation. Getting stuck at root login shell?
+
 
+
Yeah, it has to do with having 2 Graphic Cards, APU + PCI-E. You have the APU disabled in BIOS you say?
+
 
+
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
sabayon ~ # lspci
+
---cut---
+
localhost root # equo remove sys-kernel/linux-sabayon-3.13.11
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Kaveri [Radeon R7 Graphics]
+
---cut---
+
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Oland XT [Radeon HD 8670 / R7 250]
+
 
</pre>}}
 
</pre>}}
  
 +
= <span style="color:RED">TEAM RED - AMD</span> =
  
Doesn't matter. The hardware is still attached (its part of the CPU!), thus detected and configured as such. This detects both cards and populates them in order seen then assigns them separate "screens" in xorg.conf.
+
==FGLRX to Open Source (radeon or AMDGPU)==
  
The APU is first on the PCI-E bus making it "primary". Fret not! We've got your back. Until an automatic solution is found I give you the fix!
+
{{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.
  
 
+
If you don't feel fully comfortable about this command. Back up your file or use nano (vi etc.) to edit the file!
{{Console| <pre class="clear">
+
sabayon ~ # nano /etc/X11/xorg.conf
+
</pre>}}
+
 
+
 
+
The solution is to swap "BusID" in the "Device" Sections essentially swapping "Primary" and "Secondary" Cards.
+
 
+
<span style="color:red">FROM:</span>
+
{{Console| <pre class="clear">
+
Section "Device"
+
    Identifier "SabayonVga0"
+
    Driver    "fglrx"
+
    BusID      "PCI:00:01"
+
---cut--
+
EndSection
+
 
+
Section "Device"
+
    Identifier "SabayonVga1"
+
    Driver    "fglrx"
+
    BusID      "PCI:01:00"
+
---cut--
+
EndSection
+
</pre>}}
+
 
+
 
+
<span style="color:red">TO:</span>
+
{{Console| <pre class="clear">
+
Section "Device"
+
    Identifier "SabayonVga0"
+
    Driver    "fglrx"
+
    BusID      "PCI:01:00"
+
---cut--
+
EndSection
+
 
+
Section "Device"
+
    Identifier "SabayonVga1"
+
    Driver    "fglrx"
+
    BusID      "PCI:00:01"
+
---cut--
+
EndSection
+
</pre>}}
+
 
+
 
+
 
+
Now! That should fix the graphics card confusion, but you still need to get into the GUI right? Simple!
+
 
+
Just replace kdm with whichever desktop manager you use such as gdm(Gnome), lightdm(other), kdm(KDE).
+
 
+
{{Console| <pre class="clear">
+
sabayon ~ # systemctl restart kdm
+
</pre>}}
+
 
+
{{Warning| '''NEED TO KNOW'''
+
 
+
This Fix will work to get you into the GUI from disk to Install Sabayon. After install you may have to perform this fix one more time once booting from HDD, as this fix isn't copied over to the HDD during install. You will not need to perform this fix everytime. Once to get to installer, then once to setup the installed OS.
+
 
}}
 
}}
= <span style="color:green">AMD - Open Source to FGLRX</span> =
 
  
{{Warning| '''CROSSFIRE'''
 
  
Do you have an AMD system? Do you have IOMMU enabled? Crossfire DOES NOT WORK when IOMMU is enabled. You will need to make sure it it disabled in the BIOS. There is a catch, if you system was setup with IOMMU enabled, your linux setup may depend on IOMMU for your inputs meaning your Keyboard and Mouse could quit responding in Linux if you disable IOMMU.  
+
"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.
 
+
Re-enabling IOMMU would bring them back, but CROSSFIRE will refuse to work. You may end up requiring re-installing or repairing your install with IOMMU disabled to get Crossfire.  Why is Windows not affected by this option you ask? IOMMU is strictly a Linux option/enhancement. Windows has a dummy driver which ignores IOMMU entirely.  
+
}}
+
 
+
 
+
 
+
== 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 root # equo update --force
+
localhost root # equo update
localhost root # equo remove ati-drivers
+
localhost root # equo remove ati-drivers ati-userspace amdcccle
localhost root # equo remove xf86-video-ati
+
localhost root # equo install xf86-video-ati xf86-video-amdgpu
localhost root # equo remove x11-base/xorg-drivers
+
localhost root # eselect opengl set xorg-x11
localhost root # equo remove --configfiles xf86-video-ati
+
localhost root # sed -i 's/nomodeset//g' /etc/default/grub
localhost root # echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf
+
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>}}
  
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.
+
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/
 
+
 
+
Now we need to disable KMS (Kernel Mode Setting)
+
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost root # nano /etc/default/grub
+
localhost root # vi /etc/X11/xorg.conf.d/30-Devices.conf
 
</pre>}}
 
</pre>}}
  
==Editing /etc/default/grub==
+
Now we can add typical xorg.conf configurations for the devices such as tearfree. This is typically for the more savvy.
 
+
You will notice a Difference. I have highlighted in Red what needs to be added.
+
 
+
    # Copyright 1999-2012 Gentoo Foundation
+
    # 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
+
   
+
 
+
Populate the changes
+
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost root # grub2-mkconfig -o /boot/grub/grub.cfg
+
Section "Device"
 +
Identifier "Card0"
 +
Driver "amdgpu"
 +
BusID "PCI:1:0:0"
 +
Option "TearFree" "True"
 +
Option "EnablePageFlip" "True"
 +
EndSection
 
</pre>}}
 
</pre>}}
  
  
==Install==
 
  
  
OK, lets install the drivers and set the links to the GL libraries.   
+
== AMDGPU w/Display Code <span sytle="color:red">*EXPERIMENTAL!*</span> ==
{{Console| <pre class="clear">
+
localhost root # equo install --bdeps x11-drivers/ati-drivers-14.4#$(uname -r) ati-userspace amdcccle
+
localhost root # eselect opengl set ati
+
localhost root # eselect opencl set amd
+
</pre>}}
+
  
  
Need an updated or new xorg.conf? If you weren't using fglrx before then... yes.
+
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 (hopefully soon) LLVM.
Backup old and update.
+
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.
  
{{Console| <pre class="clear">
+
{{Warning| '''AMD Display Code is not mainline!'''
localhost root # cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
+
This is all 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.
localhost root # /opt/bin/aticonfig --initial
+
</pre>}}
+
 
+
OK now reboot!
+
 
+
{{Note| '''--bdeps'''
+
build time dependencies are REQUIRED!
+
aticonfig and amdcccle tools will segfault
+
upon use without build time dependencies.  
+
 
}}
 
}}
  
==Configure==
 
 
Once you login and decide you want to set resolutions and extra settings, open amdcccle.
 
  
 +
Lets get started with prep work!
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
[email protected]localhost ~ $ xhost +
+
localhost root # equo update; equo upgrade
[email protected]localhost ~ $ kdesu /opt/bin/amdcccle
+
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>}}
 
</pre>}}
  
{{Note| '''xhost command'''
 
Are you getting the error below when using a sudo-like tool for a GUI application?
 
  
 
+
Now lets download a kernel with display code.
No protocol specified
+
xhost:  unable to open display ":0.0"
+
 
+
 
+
There has been some security work done to prevent this. Using the xhost command above you can
+
temporarily disable access control for X allowing kdesu,gksu, and sudo for X applicaions to work.
+
 
+
}}
+
 
+
==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">
[email protected]localhost ~ $ su
+
localhost root # git clone -b amd-staging-drm-next --depth=1 git://people.freedesktop.org/~agd5f/linux   
localhost root # equo remove sys-kernel/linux-sabayon-3.13.11
+
localhost root # mv linux /usr/src/linux-4.13.0-amdgpu
 +
localhost root # cd /usr/src
 +
localhost root # rm -rf linux
 +
localhost root # ln -s linux-4.13.0-amdgpu/ linux
 +
localhost root # cd linux
 
</pre>}}
 
</pre>}}
  
==Roll Back==
 
  
If you're looking at this. We are either curious or ran into a snag.
+
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.
Good News: everything is reversible!
+
 
+
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.  
+
When you reach the Grub selection screen press an arrow key to halt the timer and select the "Advanced Options....".
+
Then you will select the option with "(Recovery Mode)"
+
 
+
This will take you through the normal boot process, then will put you at a CLI screen and request the root password.
+
Enter the root password and you will be brought into a terminal as root!
+
 
+
Now to start putting things back!
+
  
 
{{Console| <pre class="clear">
 
{{Console| <pre class="clear">
localhost root # equo update
+
localhost root # zcat /proc/config.gz > /usr/src/config
localhost root # equo remove ati-drivers ati-userspace amdcccle
+
localhost root # sed -i '5495 a CONFIG_DRM_AMD_DC=y' /usr/src/config
localhost root # equo install xf86-video-ati
+
localhost root # sed -i '5496 a CONFIG_DRM_AMD_DC_DCN1_0=y' /usr/src/config
localhost root # equo install x11-base/xorg-drivers
+
localhost root # genkernel --kernel-config=/usr/src/config --menuconfig --splash=sabayon --luks all
localhost root # eselect opengl set xorg-x11
+
localhost root # grub2-mkconfig -o /boot/grub/grub.cfg
localhost root # sed -i '/blacklist radeon/d' /etc/modprobe.d/blacklist.conf
+
localhost root # sed -i 's/\<nomodeset\>//g' /etc/default/grub
+
localhost root # 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.
  
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.
+
= <span style="color:green">TEAM GREEN - NVIDIA</span> =
 
+
If you don't feel fully comfortable about this command. Back up your file or use nano (vi etc.) to edit the file!
+
}}
+
 
+
 
+
 
+
 
+
 
+
 
+
= <span style="color:green">NVIDIA</span> =
+
 
If for some reason you don't have proprietary Nvidia drivers installed and you want them, there are simple steps to follow.
 
If for some reason you don't have proprietary Nvidia drivers installed and you want them, there are simple steps to follow.
 
== Update package database ==
 
 
First thing is to make sure that package database is up to date.
 
{{Console| <pre class="clear"># equo update --force</pre>}}
 
  
 
== Available driver version ==
 
== Available driver version ==
Line 356: Line 197:
 
Knowing what driver version you want to install (usually the newest, i.e. highest number version, it may differ if you have old card that needs older drivers):
 
Knowing what driver version you want to install (usually the newest, i.e. highest number version, it may differ if you have old card that needs older drivers):
 
=== Newest drivers for currently running kernel ===
 
=== Newest drivers for currently running kernel ===
{{Console| <pre class="clear"># equo install --ask nvidia-driver#$(uname -r) nvidia-userspace</pre>}}
+
{{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.
 
Will install newest driver available for currently running kernel.
  
 
=== Older drivers for currently running kernel ===
 
=== Older drivers for currently running kernel ===
 
List Nvidia drivers for your current kernel (insturctions above), and install it along with corresponding '''nvidia-userspace''', e.g.:
 
List Nvidia drivers for your current kernel (insturctions above), and install it along with corresponding '''nvidia-userspace''', e.g.:
{{Console| <pre class="clear"># equo install --ask nvidia-drivers-304.108#$(uname -r) nvidia-drivers-304.108</pre>}}
+
{{Console| <pre class="clear">localhost root # equo install --ask nvidia-drivers-304.108#$(uname -r) nvidia-drivers-304.108</pre>}}
  
 
== Block nouveau driver ==
 
== Block nouveau driver ==
 
For Nvidia drivers to work properly nouveau can't be loaded. Thus, it must be blocked.
 
For Nvidia drivers to work properly nouveau can't be loaded. Thus, it must be blocked.
  
{{Console| <pre class="clear"># echo blacklist nouveau >> /etc/modprobe.d/blacklist.conf </pre>}}
+
{{Console| <pre class="clear">localhost root # echo blacklist nouveau >> /etc/modprobe.d/blacklist.conf </pre>}}
  
 
== Set Nvidia drivers as active ==
 
== Set Nvidia drivers as active ==
{{Console| <pre class="clear"># eselect opengl set nvidia</pre>}}
+
{{Console| <pre class="clear">localhost root # eselect opengl set nvidia</pre>}}
 
+
  
 
[[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 13:58, 14 October 2017

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 (hopefully soon) 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.

Stop.png
AMD Display Code is not mainline!

This is all 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.13.0-amdgpu
localhost root # cd /usr/src
localhost root # rm -rf linux
localhost root # ln -s linux-4.13.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

If for some reason you don't have proprietary Nvidia drivers installed and you want them, there are simple steps to follow.

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)

Installation

Knowing what driver version you want to install (usually the newest, i.e. highest number version, it may differ if you have old card that needs older drivers):

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

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-304.108#$(uname -r) nvidia-drivers-304.108

Block nouveau driver

For Nvidia drivers to work properly nouveau can't be loaded. Thus, it must be blocked.

localhost root # echo blacklist nouveau >> /etc/modprobe.d/blacklist.conf 

Set Nvidia drivers as active

localhost root # eselect opengl set nvidia