@@ -116,6 +116,17 @@ _install_prerequisites() (
116
116
dnf config-manager --set-disabled rhel-9-for-$DRIVER_ARCH -baseos-eus-rpms || true
117
117
fi
118
118
119
+ # try with EUS disabled, if it does not work, then try just major version
120
+ if ! dnf makecache --releasever=${DNF_RELEASEVER} ; then
121
+ # If pointing to DNF_RELEASEVER does not work, we point to the RHEL_MAJOR_VERSION as a last resort
122
+ if ! dnf makecache --releasever=${RHEL_MAJOR_VERSION} ; then
123
+ echo " FATAL: failed to update the dnf metadata cache after multiple attempts with releasevers ${DNF_RELEASEVER} , ${RHEL_MAJOR_VERSION} "
124
+ exit 1
125
+ else
126
+ DNF_RELEASEVER=${RHEL_MAJOR_VERSION}
127
+ fi
128
+ fi
129
+
119
130
echo " Installing Linux kernel headers..."
120
131
dnf -q -y --releasever=${DNF_RELEASEVER} install kernel-headers-${KERNEL_VERSION} kernel-devel-${KERNEL_VERSION} > /dev/null
121
132
ln -s /usr/src/kernels/${KERNEL_VERSION} /lib/modules/${KERNEL_VERSION} /build
@@ -189,7 +200,7 @@ _create_driver_package() (
189
200
local nvidia_modeset_sign_args=" "
190
201
local nvidia_uvm_sign_args=" "
191
202
192
- trap " make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION} /build clean > /dev/null" EXIT
203
+ trap " make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION} /build clean > /dev/null" EXIT
193
204
194
205
echo " Compiling NVIDIA driver kernel modules..."
195
206
cd /usr/src/nvidia-${DRIVER_VERSION} /${KERNEL_TYPE}
@@ -209,7 +220,7 @@ _create_driver_package() (
209
220
fi
210
221
fi
211
222
212
- make -s -j SYSSRC=/lib/modules/${KERNEL_VERSION} /build nv-linux.o nv-modeset-linux.o > /dev/null
223
+ make -s -j ${MAX_THREADS} SYSSRC=/lib/modules/${KERNEL_VERSION} /build nv-linux.o nv-modeset-linux.o > /dev/null
213
224
214
225
echo " Relinking NVIDIA driver kernel modules..."
215
226
rm -f nvidia.ko nvidia-modeset.ko
@@ -660,7 +671,7 @@ update() {
660
671
fi
661
672
exec 3>& -
662
673
663
- # vgpu driver version is choosen dynamically during runtime, so pre-compile modules for
674
+ # vgpu driver version is chosen dynamically during runtime, so pre-compile modules for
664
675
# only non-vgpu driver types
665
676
if [ " ${DRIVER_TYPE} " != " vgpu" ]; then
666
677
# Install the userspace components and copy the kernel module sources.
@@ -739,10 +750,10 @@ usage() {
739
750
Usage: $0 COMMAND [ARG...]
740
751
741
752
Commands:
742
- init [-a | --accept-license]
743
- build [-a | --accept-license]
753
+ init [-a | --accept-license] [-m | --max-threads MAX_THREADS]
754
+ build [-a | --accept-license] [-m | --max-threads MAX_THREADS]
744
755
load
745
- update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG]
756
+ update [-k | --kernel VERSION] [-s | --sign KEYID] [-t | --tag TAG] [-m | --max-threads MAX_THREADS]
746
757
EOF
747
758
exit 1
748
759
}
@@ -752,10 +763,10 @@ if [ $# -eq 0 ]; then
752
763
fi
753
764
command=$1 ; shift
754
765
case " ${command} " in
755
- init) options=$( getopt -l accept-license -o a -- " $@ " ) ;;
756
- build) options=$( getopt -l accept-license,tag: -o a:t -- " $@ " ) ;;
766
+ init) options=$( getopt -l accept-license,max-threads: -o am: -- " $@ " ) ;;
767
+ build) options=$( getopt -l accept-license,tag:,max-threads: -o a:t:m: -- " $@ " ) ;;
757
768
load) options=" " ;;
758
- update) options=$( getopt -l kernel:,sign:,tag: -o k:s:t: -- " $@ " ) ;;
769
+ update) options=$( getopt -l kernel:,sign:,tag:,max-threads: -o k:s:t:m : -- " $@ " ) ;;
759
770
reload_nvidia_peermem) options=" " ;;
760
771
probe_nvidia_peermem) options=" " ;;
761
772
* ) usage ;;
766
777
eval set -- " ${options} "
767
778
768
779
ACCEPT_LICENSE=" "
780
+ MAX_THREADS=" "
769
781
KERNEL_VERSION=$( uname -r)
770
782
PRIVATE_KEY=" "
771
783
PACKAGE_TAG=" "
@@ -774,6 +786,7 @@ for opt in ${options}; do
774
786
case " $opt " in
775
787
-a | --accept-license) ACCEPT_LICENSE=" yes" ; shift 1 ;;
776
788
-k | --kernel) KERNEL_VERSION=$2 ; shift 2 ;;
789
+ -m | --max-threads) MAX_THREADS=$2 ; shift 2 ;;
777
790
-s | --sign) PRIVATE_KEY=$2 ; shift 2 ;;
778
791
-t | --tag) PACKAGE_TAG=$2 ; shift 2 ;;
779
792
--) shift ; break ;;
0 commit comments