M-Bab / linux-kernel-amdgpu-binaries

Kernel binaries (amd64) of amd-staging with DAL and latest security patches
213 stars 29 forks source link

Feature Request: Build with GCN 1.0 (CIK) support #2

Closed magicmyth closed 7 years ago

magicmyth commented 7 years ago

Would it be possible to have your builds enable the GCN 1.0 amdgpu support? This will allow your kernel builds to work with the earlier GCN hardware.

CONFIG_DRM_AMDGPU_CIK=y

On a side note. Linux 4.9 had the initial amdgpu experimental support for GCN 1.0 hardware but it had a performance regression for some of the hardware (e.g. Pitcairn/Curaçao, R9 270x) compared to the radeon module which seemed to be fixed in 4.10. I know your branch is based on Alex Deucher 4.9 branch but does it includes the latest upstream amdgpu work (post 4.9)?

Thanks for your work.

M-Bab commented 7 years ago

Yeah I will include this in the next build (I am sure 4.9.21 will be released this week then I will upload a build with CONFIG_DRM_AMDGPU_CIK=y). I must have disabled this option before when I just built the kernel for myself ;-).

amd-staging-4.9 is just based on the 4.9 vanilla kernel - but in fact it is the most actively developed kernel from the AMD guys that includes the DAL/DC code. No worry about any regressions from the 4.9 vanilla equivalent. Concerning feature/bug level of amdgpu code the amd-staging-4.9 kernel always matches the bleeding edge development (with all advantages and risks). At the moment most commits to drm-next-4.12 (https://cgit.freedesktop.org/~agd5f/linux/log/?h=drm-next-4.12) can also be found in amd-staging-4.9 (https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-4.9). So you can be sure to get the AMD support highlights of kernels 4.10, 4.11 and 4.12 already now with the amd-staging-4.9.

gordo1701e commented 7 years ago

First off, thx for taking the time to do this! Greatly appreciated.. question for you though, have you heard anything official about when all this dal/DC code is going to make it into the mainline kernel? I've been trying to find out but everything I've seen is at least a month old. It would be nice to be able to run an official kernel and have sound working.

M-Bab commented 7 years ago

Hi. Well the effort is not that much since I build the kernel for my use anyway. Sorry I have no information about this - best source for this kind of stuff is always phoronix. But if I remember correctly, I read that AMD will only develop the Vega open source code WITH DC while all the previous times it was rejected by kernel developers. So we are heading up to a collission in the next monts - stay excited ;-)

Publishing this kernel was a frustrated step since HDMI sound won't come for Ubuntu 17.04 either. And it is also a symbol that users don't care about kernel code politics but they want hardware support features that were existing already years ago and should be self-evident.

magicmyth commented 7 years ago

Thanks @M-Bab. Both for the future change and feeback. Much appreciated :) I'll test out 4.21 when it is out

M-Bab commented 7 years ago

Okay 4.9.21+ is out and includes the feature. If it works I will close the issue.

magicmyth commented 7 years ago

Thanks for doing that. Much appreciated. Unfortunately I am away from my computer that has the GCN 1.0 in it for the next couple of weeks but I will test as soon as I get the chance.

gordo1701e commented 7 years ago

Hey Mbab, stupid Question time again!! :) is there a way to do this (merge the DC/DAL code,) into the current mainline kernel? Not that I don't appreciate your effort but I'd like to figure out how to do this stuff for myself and not have to rely on people to do it for me.. thx in advance for any pointers!! :)

Brainiarc7 commented 7 years ago

Hey there,

It's possible

You'd need to download the kernel sources for both the mainline and this branch , then generate a diff between both directories. It's from this diff that you'll then patch the mainline tree then proceed with configuring and building the kernel.

I'm going to assume that you're familiar with diff and patch.

On Apr 22, 2017 3:55 AM, "gordo1701e" notifications@github.com wrote:

Hey Mbab, stupid Question time again!! :) is there a way to do this (merge the DC/DAL code,) into the current mainline kernel? Not that I don't appreciate your effort but I'd like to figure out how to do this stuff for myself and not have to rely on people to do it for me.. thx in advance for any pointers!! :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/M-Bab/linux-kernel-amdgpu-binaries/issues/2#issuecomment-296335635, or mute the thread https://github.com/notifications/unsubscribe-auth/ACP2h9R1ActySKfndoYxNbTK5BJCTfVIks5ryU_2gaJpZM4Mxe_- .

Brainiarc7 commented 7 years ago

If you are not confident about this, let me know what OS you're on, what target kernel you intend to merge these changes on and if possible, whether you'd like a custom built kernel package for this.

On Apr 22, 2017 1:57 PM, "Dennis Mungai" dmngaie@gmail.com wrote:

Hey there,

It's possible

You'd need to download the kernel sources for both the mainline and this branch , then generate a diff between both directories. It's from this diff that you'll then patch the mainline tree then proceed with configuring and building the kernel.

I'm going to assume that you're familiar with diff and patch.

On Apr 22, 2017 3:55 AM, "gordo1701e" notifications@github.com wrote:

Hey Mbab, stupid Question time again!! :) is there a way to do this (merge the DC/DAL code,) into the current mainline kernel? Not that I don't appreciate your effort but I'd like to figure out how to do this stuff for myself and not have to rely on people to do it for me.. thx in advance for any pointers!! :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/M-Bab/linux-kernel-amdgpu-binaries/issues/2#issuecomment-296335635, or mute the thread https://github.com/notifications/unsubscribe-auth/ACP2h9R1ActySKfndoYxNbTK5BJCTfVIks5ryU_2gaJpZM4Mxe_- .

M-Bab commented 7 years ago

I would recommend starting fresh of the newest branch from https://cgit.freedesktop.org/~agd5f/linux/ that supports DAL/DC. You can detect it in the source tree if dc/dal code exists in drivers/gpu/drm/amd. But I think the most recent branch for this is still amd-staging-4.9

Then you can either:

  1. Create a "DC/DAL" patch from the base kernel release. E.g. for amd-staging-4.9: git diff 69973b830859bc6529a7a0468ba0d80ee5117826 HEAD . Apply this patch on to the mainline kernel.
  2. Start with amd-staging-4.9 HEAD and apply the mainline patches to the current mainline.

Both ways will give you significantly more merge errors than I have currently by just security patching 4.9. This is due to the obvious fact that amd developments are stepwise implemented with kernel mainline versions. Generally resolve the merge errors by prioritizing agd5f source within drivers/gpu/drm/amd and the linux source everywhere else. But you should have an actual look at the source in all conflicts.

So far I did not bother about 4.10 and 4.11 - I don't need any of the non amdgpu-features that these new kernels provide at the moment. And 4.9 is a longterm support kernel which is nice. And as mentioned patching to newer mainlines is a bit more tricky ;-)

M-Bab commented 7 years ago

When you try to learn the stuff you can also start easy mode: Clone the source to these binaries from https://github.com/M-Bab/linux-kernel-amdgpu, create your branch based on mbab-4.9 or amd-staging-4.9. Pull changes from amd-staging-4.9, try to patch the kernel with incremental patches, try adjusting the kernel config.

Finally build the kernel with: fakeroot make-kpkg clean time fakeroot make-kpkg --initrd --revision=$(date +%y.%m.%d).AMDGPU kernel_image kernel_headers -j 5

I have no idea how experienced you are but maybe you can learn a lot by doing this...

gordo1701e commented 7 years ago

I'm actually not really familiar with any of this stuff but I'm trying to learn it. I'm assuming I can just download the tarball from kernel.org for the mainline and extract it, then I would have to clone the git tree for amd-staging and figure out how to generate the differences from those two, correct? My question then becomes, how to go about generating the differences and the patch from that.


From: Dennis E. Mungai notifications@github.com Sent: April 22, 2017 6:57:38 AM To: M-Bab/linux-kernel-amdgpu-binaries Cc: gordo1701e; Comment Subject: Re: [M-Bab/linux-kernel-amdgpu-binaries] Feature Request: Build with GCN 1.0 (CIK) support (#2)

Hey there,

It's possible

You'd need to download the kernel sources for both the mainline and this branch , then generate a diff between both directories. It's from this diff that you'll then patch the mainline tree then proceed with configuring and building the kernel.

I'm going to assume that you're familiar with diff and patch.

On Apr 22, 2017 3:55 AM, "gordo1701e" notifications@github.com wrote:

Hey Mbab, stupid Question time again!! :) is there a way to do this (merge the DC/DAL code,) into the current mainline kernel? Not that I don't appreciate your effort but I'd like to figure out how to do this stuff for myself and not have to rely on people to do it for me.. thx in advance for any pointers!! :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/M-Bab/linux-kernel-amdgpu-binaries/issues/2#issuecomment-296335635, or mute the thread https://github.com/notifications/unsubscribe-auth/ACP2h9R1ActySKfndoYxNbTK5BJCTfVIks5ryU_2gaJpZM4Mxe_- .

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/M-Bab/linux-kernel-amdgpu-binaries/issues/2#issuecomment-296365448, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZpFaaAJ5SMg2PkVzyERS4bJpj2PtkWPks5ryd0igaJpZM4Mxe_-.

M-Bab commented 7 years ago

Well you can try this ... but don't be disappointed if it doesn't work (kernel code is rather complex, the diffs you will generate are enormous). You might also try to copy drivers/gpu/drm/amd from amd-staging-4.9 to kernel 4.11 - this won't work at all but it is educational. I still recommend sticking to the steps I suggested (preferably nr. 2).

The tools to google here are diff, patch and the corresponding "git diff" and "git apply". Good luck!

gordo1701e commented 7 years ago

Perfect! Thx for the pointers both of you. Greatly appreciated!

On Apr 24, 2017 15:29, Martin notifications@github.com wrote:

Well you can try this ... but don't be disappointed if it doesn't work (kernel code . You might also try to copy drivers/gpu/drm/amd from amd-staging-4.9 to kernel 4.11 - this won't work at all but it is educational. I still recommend sticking to the steps I suggested (preferably nr. 2).

The tools to google here are diff, patch and the corresponding "git diff" and "git apply". Good luck!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/M-Bab/linux-kernel-amdgpu-binaries/issues/2#issuecomment-296797775, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZpFaeeLlUZkRKsiRmW0pDEKXana6s5Aks5rzPgwgaJpZM4Mxe_-.

magicmyth commented 7 years ago

Just confirming that this is working just fine for GCN 1.0 cards now. I tested on a R7 370 and confirmed Vulkan was working via Mad Max's Vulkan beta. It greatly improves that game's performance for me.

As a note to others, you will probably need to adjust your kernel boot params (e.g. via Grub) with the following line:

modprobe.blacklist=radeon

I found adding it to the blacklist.conf file of modprobe does not reliably work but the above method succeeds in preventing the radeon module from interfering.

Thanks M-Bab.

M-Bab commented 7 years ago

Glad to hear that. So this issue can be closed.