Skip to content

Commit

Permalink
Introduce proprietary_binary_cuda_version_mapping to allow for bett…
Browse files Browse the repository at this point in the history
…er CUDA version mapping

Allows us to support download urls that have unique mappings
per CUDA major version
  • Loading branch information
robertmaynard committed Jul 19, 2024
1 parent c7fece3 commit 037a141
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
14 changes: 14 additions & 0 deletions docs/cpm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,25 @@ as needed.
- ``${version}`` will be evaluated to the contents of the ``version`` field.
- ``${cuda-toolkit-version}`` will be evaluated to 'major.minor' of the current CUDA Toolkit version.
- ``${cuda-toolkit-version-major}`` will be evaluated to 'major' of the current CUDA Toolkit version.
- ``${cuda-toolkit-version-mapping}`` will be evaluated to the contents of the json `cuda_version_mapping` entry
of the current CUDA Toolkit major version value
- ``$ENV{variable}`` will be evaluated to the contents of the listed environment variable

If this field exists in the default package, the value will be ignored when an override file
entry exists for the package. This ensures that the git url or `proprietary_binary` entry in the override will be used.

``proprietary_binary_cuda_version_mapping``

An optional dictionary of CUDA major version keys to abitrary values that are needed to compute download urls for a pre-built proprietary binaries
in the ``proprietary_binary`` dictionary

.. literalinclude:: /packages/cuda_version_mapping.json
:language: json

As this represents meta information needed by the proprietary binary dictonary only the following packages support this entry:
- nvcomp


rapids-cmake package versions
#############################

Expand Down
10 changes: 10 additions & 0 deletions docs/packages/cuda_version_mapping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"proprietary_binary_cuda_version_mapping": {
"11": "11.8",
"12": "12.3"
},
"proprietary_binary": {
"aarch64-linux": "<url>/binary_${cuda-toolkit-version-mapping}.tar.gz",
"x86_64-linux": "<url>/binary_${cuda-toolkit-version-mapping}.tar.gz"
}
}
9 changes: 9 additions & 0 deletions rapids-cmake/cpm/detail/get_proprietary_binary_url.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ function(rapids_cpm_get_proprietary_binary_url package_name version url_var)
find_package(CUDAToolkit REQUIRED)
set(cuda-toolkit-version ${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR})
set(cuda-toolkit-version-major ${CUDAToolkit_VERSION_MAJOR})

# See if we have a CUDA Toolkit version mapping entry and load it as needed
string(JSON cuda-toolkit-version-mapping ERROR_VARIABLE have_error_mapping GET
"${override_json_data}" "proprietary_binary_cuda_version_mapping"
"${cuda-toolkit-version-major}")
if(have_error_mapping)
string(JSON cuda-toolkit-version-mapping ERROR_VARIABLE have_error_mapping GET "${json_data}"
"proprietary_binary_cuda_version_mapping" "${cuda-toolkit-version-major}")
endif()
endif()

# Evaluate any magic placeholders in the proprietary_binary value including the
Expand Down
8 changes: 6 additions & 2 deletions rapids-cmake/cpm/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@
"version": "3.0.6",
"git_url": "https://github.com/NVIDIA/nvcomp.git",
"git_tag": "v2.2.0",
"proprietary_binary_cuda_version_mapping": {
"11": "11.x",
"12": "12.x"
},
"proprietary_binary": {
"x86_64-linux": "https://developer.download.nvidia.com/compute/nvcomp/${version}/local_installers/nvcomp_${version}_x86_64_${cuda-toolkit-version-major}.x.tgz",
"aarch64-linux": "https://developer.download.nvidia.com/compute/nvcomp/${version}/local_installers/nvcomp_${version}_SBSA_${cuda-toolkit-version-major}.x.tgz"
"x86_64-linux": "https://developer.download.nvidia.com/compute/nvcomp/${version}/local_installers/nvcomp_${version}_x86_64_${cuda-toolkit-version-mapping}.tgz",
"aarch64-linux": "https://developer.download.nvidia.com/compute/nvcomp/${version}/local_installers/nvcomp_${version}_SBSA_${cuda-toolkit-version-mapping}.tgz"
}
},
"nvtx3": {
Expand Down

0 comments on commit 037a141

Please sign in to comment.