What NVIDIA-*.run arguments are needed to build kernel modules inside docker without access to hardware for use in an embedded system?

We are in the process of formalising a portion of our automated build process to include building the toolchain used in later stages of the overall build process. Our automated build system is based on using Docker containers. The containers run on a build server that may not be running the same kernel as the toolchain will be targeting, and does not have the same hardware. The NVidia card that needs to be supported by the build is not present in the build server. As such, I need to build the NVidia kernel modules without installing them, without access to the target hardware, only using command arguments, source, and binaries from earlier build stages.

Support is needed for the following cards:

  • Geforce GT 630
  • Quadro K1200
  • Quadro P1000

Kernel being built against:

  • 4.4.X

NVidia Driver:

  • 384.59
  • 390.25

Any assistance in producing a procedure would be greatly appreciated.

The installer just builds the modules from the kernel/ subdirectory of the driver package using the normal KBUILD interface. Your best bet might be to extract the package with the --extract-only option, go into the kernel/ subdirectory, and build the modules with make and the appropriate KBUILD parameters that you’d use to build any other out-of-tree module.