Building initial module for 4.12.3-towo.2-siduction-amd64Error! Bad return status for module build on kernel: 4.12.3-towo.2-siduction-amd64 (x86_64)Consult /var/lib/dkms/nvidia-legacy-340xx/340.102/build/make.log for more information.
https://devtalk.nvidia.com/default/topic/1019362/linux/fully-working-patch-for-nvidia-driver-340-102-compiler-installer-file-and-linux-kernel-4-12/towo, I guess you've seen this by now?
nvidia-graphics-drivers-legacy-340xx (340.102-3) unstable; urgency=medium [ Andreas Beckmann ] * disable-preempt_rt_sanity_check.patch: Remove, unsupported upstream. * Bump Standards-Version to 4.0.1. No changes needed. * nvidia-alternative: Explicitly use interest-await triggers. * Switch from dh_install --list-missing to dh_missing. * Use dpkg makefile snippets instead of manual parsing. * build-module-packages.sh: Order kernels by descending version. * Switch watch URL from ftp:// to https:// (375.82-1). * Update lintian overrides. [ Luca Boccassi ] * Add set-memory.patch to fix kernel module build on Linux 4.12 and newer. (Closes: #872330)