kmod-6.18-nvidia-r580: add gdrcopy subpackage#462
Conversation
Adds gdrdrv (v2.5.2) for open-gpu and tesla driver paths. Includes a misc_register patch so /dev/gdrdrv is created automatically. Signed-off-by: Gaurav Sharma <mgsharm@amazon.com>
| [[package.metadata.build-package.external-files]] | ||
| url = "https://github.com/NVIDIA/gdrcopy/archive/refs/tags/v2.5.2.tar.gz" | ||
| sha512 = "c717f118eff8cd5a8dc35613c3881818f8b71dc493461dd0151ce7c882f8e2c2d852e22733fab4e2bec57219e10eec874c11b4fad90dd4815ae572840ed19d28" | ||
| force-upstream = true |
There was a problem hiding this comment.
This is not correct. This kernel module is MIT and we can distribute its sources.
| @@ -0,0 +1,84 @@ | |||
| From: Bottlerocket Kernel Kit <noreply@amazon.com> | |||
There was a problem hiding this comment.
I understand where are you coming from with this patch, but I'll prefer if we take a different approach just so that we don't carry-on a patch.
I think we can extend ghostdog to create the device and call it after we load the kernel module, as a subsequent ExecStart call. It will basically do what the insmod script does in the GDRCopy repo.
| Source20: https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/x86_64/nvidia-imex-%{tesla_ver}-1.amzn2023.x86_64.rpm | ||
| Source21: https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/sbsa/nvidia-imex-%{tesla_ver}-1.amzn2023.aarch64.rpm | ||
|
|
||
| Source100: https://github.com/NVIDIA/gdrcopy/archive/refs/tags/v%{gdrcopy_ver}.tar.gz |
There was a problem hiding this comment.
For consistency with the core kit, fetch the archive from the archives URLs. You can check what we do in other packages for the core kit.
| Ships two flavors of gdrdrv: one built against the open NVIDIA driver and one | ||
| against the proprietary driver. The right flavor is loaded at boot based on | ||
| which driver variant ghostdog matches. |
There was a problem hiding this comment.
For consistency, this isn't needed.
| %patch 2 -p1 | ||
| popd | ||
|
|
||
| pushd gdrcopy-%{gdrcopy_ver}/src/gdrdrv |
There was a problem hiding this comment.
Instead of re-using sources, could you please prepare two copies of the sources for each compilation? I recall we do something similar elsewhere where we prepare two copies of the same sources but we just configure them differently.
| NVIDIA_IS_OPENSOURCE=y \ | ||
| HAVE_VM_FLAGS_SET=y \ | ||
| HAVE_PROC_OPS=y \ | ||
| KBUILD_EXTRA_SYMBOLS="%{_builddir}/NVIDIA-Linux-%{_cross_arch}-%{tesla_ver}/kernel-open/Module.symvers" \ |
There was a problem hiding this comment.
These can be provided after your make just for consistency with the existing make command.
| modules | ||
|
|
||
| %{_cross_target}-strip -g --strip-unneeded gdrdrv.ko | ||
| mv gdrdrv.ko ../../gdrdrv-open-gpu.ko |
There was a problem hiding this comment.
If you have two sources, you don't have to move the kernel module and you can refer to it directly in the install section.
| make clean | ||
|
|
||
| NVIDIA_SRC_DIR="%{_builddir}/NVIDIA-Linux-%{_cross_arch}-%{tesla_ver}/kernel/nvidia" \ | ||
| NVIDIA_IS_OPENSOURCE=y \ |
There was a problem hiding this comment.
This is not the open source version, right?
| LD=%{_cross_target}-ld \ | ||
| modules | ||
|
|
||
| %{_cross_target}-strip -g --strip-unneeded gdrdrv.ko |
There was a problem hiding this comment.
Do you need to strip the kernel symbols? Isn't that already done when the kernel module is built?
Adds gdrdrv (v2.5.2) for open-gpu and tesla driver paths. Includes a misc_register patch so /dev/gdrdrv is created automatically.
Description of changes:
Testing done:
Details
bash-5.2# ls -l /sys/class/misc/gdrdrv lrwxrwxrwx. 1 root root 0 Jun 10 17:53 /sys/class/misc/gdrdrv -> ../../devices/virtual/misc/gdrdrvTerms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.