-
Notifications
You must be signed in to change notification settings - Fork 37
Amd gpu support dkms #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Amd gpu support dkms #320
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| *.rpm |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| The Linux Kernel is provided under: | ||
|
|
||
| SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note | ||
|
|
||
| Being under the terms of the GNU General Public License version 2 only, | ||
| according with: | ||
|
|
||
| LICENSES/preferred/GPL-2.0 | ||
|
|
||
| With an explicit syscall exception, as stated at: | ||
|
|
||
| LICENSES/exceptions/Linux-syscall-note | ||
|
|
||
| In addition, other licenses may also apply. Please see: | ||
|
|
||
| Documentation/process/license-rules.rst | ||
|
|
||
| for more details. | ||
|
|
||
| All contributions to the Linux Kernel are subject to this COPYING file. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| [package] | ||
| name = "kmod-6_12-amdgpu" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
| publish = false | ||
| build = "../build.rs" | ||
|
|
||
| [package.metadata.build-package] | ||
| package-name = "kmod-6.12-amdgpu" | ||
|
|
||
| [lib] | ||
| path = "../packages.rs" | ||
|
|
||
| [[package.metadata.build-package.external-files]] | ||
| url = "https://repo.radeon.com/amdgpu/30.10.2/el/10/main/x86_64/amdgpu-dkms-6.14.14-2226257.el10.noarch.rpm" | ||
| sha512 = "ffe054d3673f729786a32cf8a67d69b942348eb12d800073a7efc873fcba8a760485a003ed1bfb5273eda5f7d514263c80a97243371d36bf69ea986137f8c41e" | ||
| force-upstream = true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can skip this and treat it like a normal source. |
||
|
|
||
| [build-dependencies] | ||
| kernel-6_12 = { path = "../kernel-6.12" } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,72 @@ | ||||||
| %global kernel_major 6.12 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can move this into the kernel-6.12 build so its just included with the rest of the kernel built in one shot. |
||||||
| %global kernel_sources %{_cross_usrsrc}/kernels/%{kernel_major} | ||||||
| %global _cross_kver %{kernel_major}.55 | ||||||
| %global _cross_kmoddir %{_cross_libdir}/modules/%{_cross_kver} | ||||||
| %global _ko ko | ||||||
|
|
||||||
| Name: %{_cross_os}kmod-6.12-amdgpu | ||||||
| Version: 30.10 | ||||||
| Release: 1%{?dist} | ||||||
| Summary: AMD GPU drivers for the 6.12 kernel | ||||||
| License: GPL-2.0 WITH Linux-syscall-note | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The license doesn't match the license in the |
||||||
| URL: https://www.amd.com/ | ||||||
|
|
||||||
| Source0: https://repo.radeon.com/amdgpu/30.10.2/el/10/main/x86_64/amdgpu-dkms-6.14.14-2226257.el10.noarch.rpm | ||||||
| Source1: COPYING | ||||||
|
|
||||||
| BuildRequires: %{_cross_os}kernel-6.12-devel | ||||||
| Requires: %{_cross_os}kernel-6.12 | ||||||
| Requires: %{_cross_os}linux-firmware-amd | ||||||
|
|
||||||
| %description | ||||||
| %{summary}. | ||||||
|
|
||||||
| %prep | ||||||
| # Extract DKMS source from RPM | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not compiling with |
||||||
| rpm2cpio %{S:0} | cpio -idmu './usr/src/amdgpu-*' | ||||||
| find usr/src/ -mindepth 1 -maxdepth 1 -type d -exec mv {} amdgpu \; | ||||||
| rm -r usr | ||||||
|
|
||||||
| # Apply Bottlerocket DKMS configuration | ||||||
| pushd amdgpu | ||||||
|
|
||||||
| # Configure DKMS | ||||||
| KERNELVER=%{_cross_kver} amd/dkms/configure --with-linux=%{kernel_sources} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could use the
Comment on lines
+33
to
+34
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
|
|
||||||
| popd | ||||||
|
|
||||||
| %build | ||||||
| pushd amdgpu | ||||||
|
|
||||||
| # Build using the DKMS Makefile with static configuration | ||||||
| make modules KERNELVER=%{_cross_kver} kernel_build_dir=%{_cross_usrsrc}/kernels/6.12 CC=%{_cross_target}-gcc ARCH=%{_cross_karch} CROSS_COMPILE=%{_cross_target}- EXTRA_CFLAGS=-DPACKAGE_VERSION=\\\"%{version}\\\" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need the triple |
||||||
|
|
||||||
| popd | ||||||
|
|
||||||
| %install | ||||||
| # Install license file | ||||||
| install -d %{buildroot}%{_cross_licensedir}/%{name} | ||||||
| install -p -m 0644 %{S:1} %{buildroot}%{_cross_licensedir}/%{name}/ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This license should come from |
||||||
|
|
||||||
| # Install AMD GPU kernel modules to correct location | ||||||
| install -d %{buildroot}%{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu | ||||||
| install -p -m 644 amdgpu/amd/amdkcl/amdkcl.ko %{buildroot}%{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these should use the
Suggested change
|
||||||
| install -p -m 644 amdgpu/ttm/amdttm.ko %{buildroot}%{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/ | ||||||
| install -p -m 644 amdgpu/amddrm_ttm_helper.ko %{buildroot}%{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/ | ||||||
|
Comment on lines
+54
to
+55
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A for loop over the |
||||||
| install -p -m 644 amdgpu/amddrm_buddy.ko %{buildroot}%{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/ | ||||||
| install -p -m 644 amdgpu/amddrm_exec.ko %{buildroot}%{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/ | ||||||
| install -p -m 644 amdgpu/scheduler/amd-sched.ko %{buildroot}%{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/ | ||||||
| install -p -m 644 amdgpu/amd/amdxcp/amdxcp.ko %{buildroot}%{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/ | ||||||
| install -p -m 644 amdgpu/amd/amdgpu/amdgpu.ko %{buildroot}%{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/ | ||||||
|
|
||||||
| %files | ||||||
| %license %{_cross_licensedir}/%{name}/COPYING | ||||||
| %{_cross_attribution_file} | ||||||
| %{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/amdkcl.%{_ko} | ||||||
| %{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/amdttm.%{_ko} | ||||||
| %{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/amddrm_ttm_helper.%{_ko} | ||||||
| %{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/amddrm_buddy.%{_ko} | ||||||
| %{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/amddrm_exec.%{_ko} | ||||||
| %{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/amd-sched.%{_ko} | ||||||
| %{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/amdxcp.%{_ko} | ||||||
| %{_cross_kmoddir}/kernel/drivers/gpu/drm/amd/amdgpu/amdgpu.%{_ko} | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the correct license, the RPM includes a license already: