From f18cc79bfafad4c9fcddec9c89226afff72eeb8e Mon Sep 17 00:00:00 2001 From: Patrick Force Date: Mon, 27 Nov 2023 13:03:44 -0700 Subject: [PATCH] add max-threads argument for nvidia-driver script commands so that there's an option to limit 'make -j' threads Signed-off-by: Patrick Force --- centos7/nvidia-driver | 14 ++++++++------ centos8/nvidia-driver | 14 ++++++++------ coreos/nvidia-driver | 12 +++++++----- fedora/nvidia-driver | 18 ++++++++++-------- flatcar/nvidia-driver | 12 +++++++----- photon3.0/nvidia-driver | 14 ++++++++------ rhel7/nvidia-driver | 14 ++++++++------ rhel8/nvidia-driver | 18 ++++++++++-------- sle15/nvidia-driver | 14 ++++++++------ ubuntu16.04/nvidia-driver | 14 ++++++++------ ubuntu18.04/nvidia-driver | 14 ++++++++------ ubuntu20.04/nvidia-driver | 14 ++++++++------ ubuntu22.04/nvidia-driver | 14 ++++++++------ 13 files changed, 106 insertions(+), 80 deletions(-) diff --git a/centos7/nvidia-driver b/centos7/nvidia-driver index 7eeda8e9..1c6bb85e 100755 --- a/centos7/nvidia-driver +++ b/centos7/nvidia-driver @@ -108,7 +108,7 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/kernel @@ -129,7 +129,7 @@ _create_driver_package() ( fi export IGNORE_CC_MISMATCH=1 - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -527,8 +527,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -538,8 +538,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; reload_nvidia_peermem) options="" ;; probe_nvidia_peermem) options="" ;; *) usage ;; @@ -550,6 +550,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -558,6 +559,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;; diff --git a/centos8/nvidia-driver b/centos8/nvidia-driver index 713d842c..3dea528d 100755 --- a/centos8/nvidia-driver +++ b/centos8/nvidia-driver @@ -107,13 +107,13 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/kernel export IGNORE_CC_MISMATCH=1 - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -349,8 +349,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -360,8 +360,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; *) usage ;; esac if [ $? -ne 0 ]; then @@ -370,6 +370,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -378,6 +379,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;; diff --git a/coreos/nvidia-driver b/coreos/nvidia-driver index 82c3e633..10d690a1 100755 --- a/coreos/nvidia-driver +++ b/coreos/nvidia-driver @@ -63,7 +63,7 @@ cp /proc/version /usr/src/linux/proc/ echo "Compiling NVIDIA driver kernel modules with $(gcc --version | head -1)..." cd /usr/src/nvidia-*/kernel -make -s -j SYSSRC=/usr/src/linux nv-linux.o nv-modeset-linux.o > /dev/null +make -s -j ${MAX_THREADS} SYSSRC=/usr/src/linux nv-linux.o nv-modeset-linux.o > /dev/null EOF mkdir -p /lib/modules/${KERNEL_VERSION} cp /mnt/coreos/lib/modules/${KERNEL_VERSION}/modules.* /lib/modules/${KERNEL_VERSION}/ @@ -316,8 +316,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -327,8 +327,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; *) usage ;; esac if [ $? -ne 0 ]; then @@ -337,6 +337,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -345,6 +346,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;; diff --git a/fedora/nvidia-driver b/fedora/nvidia-driver index 6dbc9c2c..a8468ad8 100755 --- a/fedora/nvidia-driver +++ b/fedora/nvidia-driver @@ -227,7 +227,7 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/${KERNEL_TYPE} @@ -247,7 +247,7 @@ _create_driver_package() ( fi fi - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -769,10 +769,10 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] [-x] - build [-a | --accept-license] + init [-a | --accept-license] [-x] [-m | --max-threads MAX_THREADS] + build [-a | --accept-license] [-m | --max-threads MAX_THREADS] load - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -782,10 +782,10 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a:x -- "$@") ;; - build) options=$(getopt -l accept-license,tag: -o a:t -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o a:x:m: -- "$@") ;; + build) options=$(getopt -l accept-license,tag:,max-threads: -o a:t:m: -- "$@") ;; load) options="" ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; reload_nvidia_peermem) options="" ;; probe_nvidia_peermem) options="" ;; *) usage ;; @@ -796,6 +796,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -804,6 +805,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; -x ) set -x; shift 1 ;; diff --git a/flatcar/nvidia-driver b/flatcar/nvidia-driver index 95716ff0..cf29ae1b 100755 --- a/flatcar/nvidia-driver +++ b/flatcar/nvidia-driver @@ -134,7 +134,7 @@ cp /lib/modules/${KERNEL_VERSION}/build/scripts/module.lds /usr/src/nvidia-*/ker cd /usr/src/nvidia-*/kernel export IGNORE_CC_MISMATCH=1 export IGNORE_MISSING_MODULE_SYMVERS=1 -make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/source nv-linux.o nv-modeset-linux.o > /dev/null +make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/source nv-linux.o nv-modeset-linux.o > /dev/null EOF mkdir -p /lib/modules/${KERNEL_VERSION} cp -r /mnt/coreos/lib/modules/${KERNEL_VERSION}/* /lib/modules/${KERNEL_VERSION}/ @@ -433,8 +433,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -444,8 +444,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; *) usage ;; esac if [ $? -ne 0 ]; then @@ -454,6 +454,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -462,6 +463,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;; diff --git a/photon3.0/nvidia-driver b/photon3.0/nvidia-driver index 676bc071..c9523677 100755 --- a/photon3.0/nvidia-driver +++ b/photon3.0/nvidia-driver @@ -98,11 +98,11 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/kernel - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -335,8 +335,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -346,8 +346,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; *) usage ;; esac if [ $? -ne 0 ]; then @@ -356,6 +356,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -364,6 +365,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;; diff --git a/rhel7/nvidia-driver b/rhel7/nvidia-driver index aeec64d0..528c1632 100755 --- a/rhel7/nvidia-driver +++ b/rhel7/nvidia-driver @@ -115,13 +115,13 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/kernel export IGNORE_CC_MISMATCH=1 - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -372,8 +372,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -383,8 +383,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; *) usage ;; esac if [ $? -ne 0 ]; then @@ -393,6 +393,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -401,6 +402,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;; diff --git a/rhel8/nvidia-driver b/rhel8/nvidia-driver index adff7aba..0105ed58 100755 --- a/rhel8/nvidia-driver +++ b/rhel8/nvidia-driver @@ -200,7 +200,7 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/${KERNEL_TYPE} @@ -220,7 +220,7 @@ _create_driver_package() ( fi fi - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -750,10 +750,10 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - build [-a | --accept-license] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + build [-a | --accept-license] [-m | --max-threads MAX_THREADS] load - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -763,10 +763,10 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - build) options=$(getopt -l accept-license,tag: -o a:t -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + build) options=$(getopt -l accept-license,tag:,max-threads: -o a:t:m: -- "$@") ;; load) options="" ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; reload_nvidia_peermem) options="" ;; probe_nvidia_peermem) options="" ;; *) usage ;; @@ -777,6 +777,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -785,6 +786,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;; diff --git a/sle15/nvidia-driver b/sle15/nvidia-driver index bffc7e21..8b999169 100755 --- a/sle15/nvidia-driver +++ b/sle15/nvidia-driver @@ -117,11 +117,11 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/source clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/source clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/kernel - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/source nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/source nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -523,8 +523,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -534,8 +534,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; *) usage ;; esac if [ $? -ne 0 ]; then @@ -544,6 +544,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -552,6 +553,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;; diff --git a/ubuntu16.04/nvidia-driver b/ubuntu16.04/nvidia-driver index 7df4e964..bac4f47d 100755 --- a/ubuntu16.04/nvidia-driver +++ b/ubuntu16.04/nvidia-driver @@ -108,13 +108,13 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/kernel export IGNORE_CC_MISMATCH=1 - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -350,8 +350,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] [-n | --nocompile] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-n | --nocompile] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -361,8 +361,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license,nocompile -o an -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,nocompile,max-threads: -o anm: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; *) usage ;; esac if [ $? -ne 0 ]; then @@ -372,6 +372,7 @@ eval set -- "${options}" ACCEPT_LICENSE="" ALLOW_RECOMPILE="yes" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -380,6 +381,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -n | --nocompile) ALLOW_RECOMPILE="no"; shift 1 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; diff --git a/ubuntu18.04/nvidia-driver b/ubuntu18.04/nvidia-driver index 71938fb2..43fe5f37 100755 --- a/ubuntu18.04/nvidia-driver +++ b/ubuntu18.04/nvidia-driver @@ -106,13 +106,13 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/kernel export IGNORE_CC_MISMATCH=1 - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -421,8 +421,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -432,8 +432,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; *) usage ;; esac if [ $? -ne 0 ]; then @@ -442,6 +442,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -450,6 +451,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;; diff --git a/ubuntu20.04/nvidia-driver b/ubuntu20.04/nvidia-driver index d53d098f..838283e0 100755 --- a/ubuntu20.04/nvidia-driver +++ b/ubuntu20.04/nvidia-driver @@ -127,7 +127,7 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/${KERNEL_TYPE} @@ -148,7 +148,7 @@ _create_driver_package() ( fi export IGNORE_CC_MISMATCH=1 - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -683,8 +683,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -694,8 +694,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; reload_nvidia_peermem) options="" ;; probe_nvidia_peermem) options="" ;; *) usage ;; @@ -706,6 +706,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -714,6 +715,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;; diff --git a/ubuntu22.04/nvidia-driver b/ubuntu22.04/nvidia-driver index ad5f1446..aedeeea2 100755 --- a/ubuntu22.04/nvidia-driver +++ b/ubuntu22.04/nvidia-driver @@ -127,7 +127,7 @@ _create_driver_package() ( local nvidia_modeset_sign_args="" local nvidia_uvm_sign_args="" - trap "make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT + trap "make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build clean > /dev/null" EXIT echo "Compiling NVIDIA driver kernel modules..." cd /usr/src/nvidia-${DRIVER_VERSION}/${KERNEL_TYPE} @@ -148,7 +148,7 @@ _create_driver_package() ( fi export IGNORE_CC_MISMATCH=1 - make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null + make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION}/build nv-linux.o nv-modeset-linux.o > /dev/null echo "Relinking NVIDIA driver kernel modules..." rm -f nvidia.ko nvidia-modeset.ko @@ -687,8 +687,8 @@ usage() { Usage: $0 COMMAND [ARG...] Commands: - init [-a | --accept-license] - update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] + init [-a | --accept-license] [-m | --max-threads MAX_THREADS] + update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS] EOF exit 1 } @@ -698,8 +698,8 @@ if [ $# -eq 0 ]; then fi command=$1; shift case "${command}" in - init) options=$(getopt -l accept-license -o a -- "$@") ;; - update) options=$(getopt -l kernel:,sign:,tag: -o k:s:t: -- "$@") ;; + init) options=$(getopt -l accept-license,max-threads: -o am: -- "$@") ;; + update) options=$(getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m: -- "$@") ;; reload_nvidia_peermem) options="" ;; probe_nvidia_peermem) options="" ;; *) usage ;; @@ -710,6 +710,7 @@ fi eval set -- "${options}" ACCEPT_LICENSE="" +MAX_THREADS="" KERNEL_VERSION=$(uname -r) PRIVATE_KEY="" PACKAGE_TAG="" @@ -718,6 +719,7 @@ for opt in ${options}; do case "$opt" in -a | --accept-license) ACCEPT_LICENSE="yes"; shift 1 ;; -k | --kernel) KERNEL_VERSION=$2; shift 2 ;; + -m | --max-threads) MAX_THREADS=$2; shift 2 ;; -s | --sign) PRIVATE_KEY=$2; shift 2 ;; -t | --tag) PACKAGE_TAG=$2; shift 2 ;; --) shift; break ;;