NVIDIA – GPL Problem with Kernel 4.18, But only for Some.. Fixed in 4.18-rc7.

Thanks to towo, for pointing out that some others have had GPL issues with the latest NVIDIA drivers and Kernel 4.18-rc6, even though they compiled/loaded OK on my test system, as reported in an earlier article..

……………
ld -r -o /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-modeset/nv-modeset-interface.o /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-modeset/nvidia-modeset-linux.o
Building modules, stage 2.
MODPOST 4 modules
CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-drm.mod.o
LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-drm.ko
CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-modeset.mod.o
LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-modeset.ko
CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-uvm.mod.o
LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-uvm.ko
CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia.mod.o
LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia.ko
make[2]: Leaving directory ‘/usr/src/linux-4.18-rc6’
make[1]: Leaving directory ‘/usr/src/linux-4.18-rc6’

See https://devtalk.nvidia.com/default/topic/1037642/linux/driver-390-77-not-compiling-in-kernel-4-18-rc5-xubuntu-18-04/ and other reports..

I changed my usual system-specific kernel config in 4.18-rc6 to the ‘Distro’ (Fedora) version, with almost-everything-selected, and was then able to reproduce the problem:

........
Building modules, stage 2.
MODPOST 4 modules
FATAL: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol '__put_devmap_managed_page'
make[3]: *** [/usr/src/linux-4.18-rc6/scripts/Makefile.modpost:92: __modpost] Error 1
make[2]: *** [/usr/src/linux-4.18-rc6/Makefile:1504: modules] Error 2
make[2]: Leaving directory '/usr/src/linux-4.18-rc6'
make[1]: *** [Makefile:146: sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-4.18-rc6'
make: *** [Makefile:79: modules] Error 2

I have checked on the offending code, in linux-4.18-rc6/kernel/memremap.c, and compared with the same file in 4.18-rc7:

4.18-rc6:
# grep EXPORT_SYMBOL memremap.c
EXPORT_SYMBOL(device_private_entry_fault);
EXPORT_SYMBOL(devm_memremap_pages);
EXPORT_SYMBOL_GPL(get_dev_pagemap);
EXPORT_SYMBOL_GPL(devmap_managed_key);
EXPORT_SYMBOL_GPL(dev_pagemap_get_ops);
EXPORT_SYMBOL_GPL(dev_pagemap_put_ops);
EXPORT_SYMBOL_GPL(__put_devmap_managed_page);

4.18-rc7:
# grep EXPORT_SYMBOL memremap.c
EXPORT_SYMBOL(device_private_entry_fault);
EXPORT_SYMBOL(devm_memremap_pages);
EXPORT_SYMBOL_GPL(get_dev_pagemap);
EXPORT_SYMBOL(devmap_managed_key);
EXPORT_SYMBOL_GPL(dev_pagemap_get_ops);
EXPORT_SYMBOL_GPL(dev_pagemap_put_ops);
EXPORT_SYMBOL(__put_devmap_managed_page);

So.. It would appear that the problem has been fixed in 4.18-rc7 (tested with the full ‘Distro’ kernel config):

 .................
Building modules, stage 2.
MODPOST 4 modules
CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-drm.mod.o
LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-drm.ko
CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-modeset.mod.o
LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-modeset.ko
CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-uvm.mod.o
LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia-uvm.ko
CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia.mod.o
LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-390.77/kernel/nvidia.ko
make[2]: Leaving directory '/usr/src/linux-4.18-rc7'
make[1]: Leaving directory '/usr/src/linux-4.18-rc7'

I should mention that using the full ‘Distro’ kernel config is not ideal for my test system, as it causes a load of ACPI and other errors at boot time, and is only for a ‘generic X86_64’…  A better solution – at least for compile-time testing – would probably be to use a VMware Fedora VM..

Robert Gadsdon.  August 1, 2018


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.