FS#72801 - fix `nvidia-dkms` failing to compile against kernel 5.16 due to removed MIGRATE_PFN_LOCKED macro
Attached to Project:
Arch Linux
Opened by Scott B (arglebargle) - Saturday, 20 November 2021, 23:33 GMT
Last edited by Antonio Rojas (arojas) - Wednesday, 26 January 2022, 08:02 GMT
Opened by Scott B (arglebargle) - Saturday, 20 November 2021, 23:33 GMT
Last edited by Antonio Rojas (arojas) - Wednesday, 26 January 2022, 08:02 GMT
|
Details
Description:
`nvidia-dkms` fails to build against kernel 5.16 due to removal of the MIGRATE_PFN_LOCKED macro upstream. If possible could you include a sed call in the PKGBUILD to strip the MIGRATE_PFN_LOCKED macro until nvidia does it themselves? Depending on nvidia's update schedule this might be needed when 5.16 is released anyway, so I figure posting the solution now won't hurt. This should be nice and safe, the kernel submission that removes the macro notes that the work MIGRATE_PFN_LOCKED does is effectively useless hence the removal, see:20211025041608.289017-1-apopple@nvidia.com/T/"> https://lore.kernel.org/linux-mm/20211025041608.289017-1-apopple@nvidia.com/T/ And here's a thread on the nvidia forums discussing build failure and solution for reference: https://forums.developer.nvidia.com/t/495-44-linux-5-16-rc1-dkms-build-fails-on-linux-5-16-rc1/195126/3 Here's the PKGBUILD change I'm using locally: ``` diff --git a/PKGBUILD b/PKGBUILD index 2d7472e..b90357f 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -53,6 +53,10 @@ DEST_MODULE_LOCATION[4]="/kernel/drivers/video"' dkms.conf # Gift for linux-rt guys sed -i 's/NV_EXCLUDE_BUILD_MODULES/IGNORE_PREEMPT_RT_PRESENCE=1 NV_EXCLUDE_BUILD_MODULES/' dkms.conf + + # fix compilation against 5.16 due to removed MIGRATE_PFN_LOCKED macro + # see:20211025041608.289017-1-apopple@nvidia.com/T/"> https://lore.kernel.org/linux-mm/20211025041608.289017-1-apopple@nvidia.com/T/ + sed -i 's/ | MIGRATE_PFN_LOCKED//g' nvidia-uvm/uvm_migrate_pageable.c } package_opencl-nvidia() { ``` Additional info: * package version(s) nvidia-dkms 495.44-5 * config and/or log files etc. compilation errors- `uvm_migrate_pageable.c:409:55: error: use of undeclared identifier 'MIGRATE_PFN_LOCKED'` * link to upstream bug report, if any n/a Steps to reproduce: Install nvidia-dkms with a 5.16 kernel present, attempt to build the module. |
This task depends upon
Have you verified this is not an issue on earlier kernels?
Edit:
sed -i '/^#include <linux\/migrate.h>$/a#ifndef MIGRATE_PFN_LOCKED\n#define MIGRATE_PFN_LOCKED 0\n#endif' nvidia-uvm/uvm_migrate_pageable.c
Cheers!