@@ -46,7 +46,7 @@ function set_cuda_runfile_url() {
4646 local MAX_DRIVER_VERSION
4747 local MAX_CUDA_VERSION
4848
49- local MIN_OPEN_DRIVER_VER="515.48.07 "
49+ MIN_OPEN_DRIVER_VER="515.43.04 "
5050 local MIN_DRIVER_VERSION="${MIN_OPEN_DRIVER_VER}"
5151 local MIN_CUDA_VERSION="11.7.1" # matches MIN_OPEN_DRIVER_VER
5252
@@ -84,7 +84,33 @@ function set_cuda_runfile_url() {
8484
8585 # driver version named in cuda runfile filename
8686 # (these may not be actual driver versions - see https://download.nvidia.com/XFree86/Linux-x86_64/)
87+ # 10.0.130/410.48 =https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux
88+ # 10.1.234/418.87.00=https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux.run
89+ # 10.2.89/440.33.01 =https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run
90+ # 11.0.3/450.51.06 =https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda_11.0.3_450.51.06_linux.run
91+ # 11.1.1/455.42.00 =https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run
92+ # 11.2.2/460.32.03 =https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run
93+ # 11.3.1/465.19.01 =https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.19.01_linux.run
94+ # 11.4.4/470.82.01 =https://developer.download.nvidia.com/compute/cuda/11.4.4/local_installers/cuda_11.4.4_470.82.01_linux.run
95+ # 11.5.2/495.29.05 =https://developer.download.nvidia.com/compute/cuda/11.5.2/local_installers/cuda_11.5.2_495.29.05_linux.run
96+ # 11.6.2/510.47.03 =https://developer.download.nvidia.com/compute/cuda/11.6.2/local_installers/cuda_11.6.2_510.47.03_linux.run
97+ # 11.7.1/515.65.01 =https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run
98+ # 11.8.0/520.61.05 =https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
99+ # 12.0.1/525.85.12 =https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda_12.0.1_525.85.12_linux.run
100+ # 12.1.1/530.30.02 =https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run
101+ # 12.2.2/535.104.05 =https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run
102+ # 12.3.2/545.23.08 =https://developer.download.nvidia.com/compute/cuda/12.3.2/local_installers/cuda_12.3.2_545.23.08_linux.run
87103 readonly -A drv_for_cuda=(
104+ ["10.0.130"]="410.48"
105+ ["10.1.234"]="418.87.00"
106+ ["10.2.89"]="440.33.01"
107+ ["11.0.3"]="450.51.06"
108+ ["11.1.1"]="455.42.00"
109+ ["11.2.2"]="460.32.03"
110+ ["11.3.1"]="465.19.01"
111+ ["11.4.4"]="470.82.01"
112+ ["11.5.2"]="495.29.05"
113+ ["11.6.2"]="510.47.03"
88114 ["11.7.0"]="515.43.04" ["11.7.1"]="515.65.01"
89115 ["11.8.0"]="520.61.05"
90116 ["12.0.0"]="525.60.13" ["12.0.1"]="525.85.12"
@@ -108,7 +134,8 @@ function set_cuda_runfile_url() {
108134 CUDA_RUNFILE="$(echo ${NVIDIA_CUDA_URL} | perl -pe 's{^.+/}{}')"
109135 readonly CUDA_RUNFILE
110136
111- if ! curl -s --head "${NVIDIA_CUDA_URL}" | grep -E -q '^HTTP.*200\s*$' ; then
137+ # version naming and archive url were erratic prior to 11.0.3
138+ if ( version_ge "${CUDA_FULL_VERSION}" "11.0.3" && ! curl -s --head "${NVIDIA_CUDA_URL}" | grep -E -q '^HTTP.*200\s*$' ) ; then
112139 echo "No CUDA distribution exists for this combination of DRIVER_VERSION=${drv_ver}, CUDA_VERSION=${CUDA_FULL_VERSION}"
113140 exit 1
114141 fi
@@ -292,13 +319,13 @@ function install_nvidia_nccl() {
292319 # Hopper: SM_90,SM_90a compute_90,compute_90a
293320 # Blackwell: SM_100, compute_100
294321 NVCC_GENCODE="-gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_72,code=sm_72"
295- NVCC_GENCODE="${NVCC_GENCODE} -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_86,code=sm_86 -gencode=arch=compute_87,code=sm_87"
322+ NVCC_GENCODE="${NVCC_GENCODE} -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_86,code=sm_86"
323+ if version_gt "${CUDA_VERSION}" "11.6" ; then
324+ NVCC_GENCODE="${NVCC_GENCODE} -gencode=arch=compute_87,code=sm_87" ; fi
296325 if version_ge "${CUDA_VERSION}" "11.8" ; then
297- NVCC_GENCODE="${NVCC_GENCODE} -gencode=arch=compute_89,code=sm_89"
298- fi
326+ NVCC_GENCODE="${NVCC_GENCODE} -gencode=arch=compute_89,code=sm_89" ; fi
299327 if version_ge "${CUDA_VERSION}" "12.0" ; then
300- NVCC_GENCODE="${NVCC_GENCODE} -gencode=arch=compute_90,code=sm_90 -gencode=arch=compute_90a,code=compute_90a"
301- fi
328+ NVCC_GENCODE="${NVCC_GENCODE} -gencode=arch=compute_90,code=sm_90 -gencode=arch=compute_90a,code=compute_90a" ; fi
302329
303330 mkdir -p "${workdir}"
304331 pushd "${workdir}"
@@ -464,8 +491,8 @@ function add_repo_cuda() {
464491}
465492
466493function build_driver_from_github() {
467- # non-GPL driver will have been built on rocky8
468- if is_rocky8 ; then return 0 ; fi
494+ # non-GPL driver will have been built on rocky8 or if driver version is prior to open kernel version
495+ if ( is_rocky8 || version_lt "${DRIVER_VERSION}" "515.43.04" ) ; then return 0 ; fi
469496 pushd "${workdir}"
470497
471498 test -d "${workdir}/open-gpu-kernel-modules" || {
@@ -592,7 +619,7 @@ function install_nvidia_userspace_runfile() {
592619 local cache_hit="0"
593620 local local_tarball
594621
595- if is_rocky8 ; then
622+ if ( is_rocky8 || version_lt "${DRIVER_VERSION}" "${MIN_OPEN_DRIVER_VER}" ) ; then
596623 local nvidia_ko_path="$(find /lib/modules/$(uname -r)/ -name 'nvidia.ko')"
597624 test -n "${nvidia_ko_path}" && test -f "${nvidia_ko_path}" || {
598625 local build_tarball="kmod_${_shortname}_${DRIVER_VERSION}.tar.gz"
@@ -604,7 +631,9 @@ function install_nvidia_userspace_runfile() {
604631
605632 if gsutil ls "${gcs_tarball}" 2>&1 | grep -q "${gcs_tarball}" ; then
606633 cache_hit="1"
607- runfile_args="--no-kernel-modules"
634+ if version_ge "${DRIVER_VERSION}" "${MIN_OPEN_DRIVER_VER}" ; then
635+ runfile_args="${runfile_args} --no-kernel-modules"
636+ fi
608637 echo "cache hit"
609638 else
610639 install_build_dependencies
@@ -619,10 +648,13 @@ function install_nvidia_userspace_runfile() {
619648 --module-signing-script \"/lib/modules/${uname_r}/build/scripts/sign-file\" \
620649 "
621650 fi
622- runfile_args="--no-dkms ${signing_options}"
651+ runfile_args="${signing_options}"
652+ if version_ge "${DRIVER_VERSION}" "${MIN_OPEN_DRIVER_VER}" ; then
653+ runfile_args="${runfile_args} --no-dkms"
654+ fi
623655 fi
624656 }
625- else
657+ elif version_ge "${DRIVER_VERSION}" "${MIN_OPEN_DRIVER_VER}" ; then
626658 runfile_args="--no-kernel-modules"
627659 fi
628660
@@ -632,7 +664,7 @@ function install_nvidia_userspace_runfile() {
632664 --install-libglvnd \
633665 --tmpdir="${tmpdir}"
634666
635- if is_rocky8 ; then
667+ if ( is_rocky8 || version_lt "${DRIVER_VERSION}" "515.43.04" ) ; then
636668 if [[ "${cache_hit}" == "1" ]] ; then
637669 gcloud storage cat "${gcs_tarball}" | tar -C / -xzv
638670 depmod -a
0 commit comments