CUDA Compatibility
CUDA Compatibility
v |
Table of Contents
Chapter 1. Why CUDA Compatibility.................................................................................... 1
Chapter 2. Minor Version Compatibility...............................................................................4
2.1. CUDA 11 and Later Defaults to Minor Version Compatibility Compatibility...........................4
2.2. Application Considerations for Minor Version Compatibility.................................................. 6
2.3. Deployment Considerations for Minor Version Compatibility.................................................6
Chapter 3. Forward Compatibility........................................................................................ 8
3.1. Forward Compatibility Support Across Major Toolkit Versions..............................................8
3.2. Installing the Forward Compatibility Package........................................................................ 9
3.2.1. From Network Repositories or Local Installers...............................................................9
3.2.2. Manually Installing from Runfile..................................................................................... 11
3.3. Deployment Considerations for Forward Compatibility........................................................ 11
3.3.1. Use the Right Compat Package...................................................................................... 11
3.3.2. Feature Exceptions...........................................................................................................12
3.3.3. Check for Compatibility Support..................................................................................... 13
3.4. Deployment Model for Forward Compatibility.......................................................................13
Chapter 4. Conclusion........................................................................................................ 15
Chapter 5. Frequently Asked Questions............................................................................ 16
Figure 3. NVRTC supports minor version compatibility from CUDA 11.3 onwards ........................ 7
®
The CUDA Toolkit enables developers to build NVIDIA GPU accelerated compute applications
for Desktop computers, Enterprise and Data centers to Hyperscalers. It consists of the CUDA
compiler toolchain including the CUDA runtime (cudart) and various CUDA libraries and
tools. To build an application, a developer has to install only the CUDA Toolkit and necessary
libraries required for linking.
In order to run a CUDA application, the system should have a CUDA enabled GPU and an
NVIDIA display driver that is compatible with the CUDA Toolkit that was used to build the
application itself. If the application relies on dynamic linking for libraries then the system
should have the right version of such libraries as well.
Every CUDA toolkit also ships with an NVIDIA display driver package for convenience. This
driver supports all the features introduced in that version of the CUDA Toolkit. Please check
the toolkit and driver version mapping in the release notes. The driver package includes both
the user mode CUDA driver (libcuda.so) and kernel mode components necessary to run the
application.
Typically, upgrading a CUDA Toolkit involves upgrading both the toolkit and the driver to get
the bleeding edge toolkit and driver capabilities.
But this is not always required. CUDA Compatibility guarantees allow for upgrading only
certain components and that will be the focus of the rest of this document. We will see how
the upgrade to a new CUDA Toolkit can be simplified to not always require a full system
upgrade.
* CUDA 11.0 was released with an earlier driver version, but by upgrading to Tesla Recommended
Drivers 450.80.02 (Linux) / 452.39 (Windows) as indicated, minor version compatibility is possible
across the CUDA 11.x family of toolkits.
While applications built against any of the older CUDA Toolkits always continued to function
on newer drivers due to binary backward compatibility, prior to CUDA 11, applications built
against newer CUDA Toolkit releases were not supported on older drivers without forward
compatibility package (see Forward Compatibility Support Across Major Toolkit Versions).
If you are using a new CUDA 10.x minor release, then the minimum required driver version
is the same as the driver that’s packaged as part of that toolkit release. Consequently, the
minimum required driver version changed for every new CUDA Toolkit minor release until
CUDA 11.1. Therefore, system administrators always have to upgrade drivers in order to
support applications built against CUDA Toolkits from 10.x releases.
With minor version compatibility, upgrading to CUDA 11.1 is now possible on older drivers
from within the same major release family such as 450.80.02 that was shipped with CUDA
11.0, as shown below:
$ nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.80.02 Driver Version: 450.80.02 CUDA Version:
11.0 |
|-------------------------------+----------------------
+----------------------+
...<snip>...
$ samples/bin/x86_64/linux/release/deviceQuery
samples/bin/x86_64/linux/release/deviceQuery Starting...
...<snip>...
Minimum required driver version guidance can be found in the release notes. Note that if the
minimum required driver version is not installed in the system, applications will return an
error as shown below.
$ samples/bin/x86_64/linux/release/deviceQuery
samples/bin/x86_64/linux/release/deviceQuery Starting...
cudaGetDeviceCount returned 3
-> initialization error
Result = FAIL
However, if an application is unable to leverage the minor version compatibility due to any
of the aforementioned reasons, then the Forward Compatibility model can be used as an
alternative even though Forward Compatibility is mainly intended for compatibility across
major toolkit versions.
Forward Compatibility is applicable only for systems with NVIDIA Data Center GPUs or select
NGC Server Ready SKUs of RTX cards. It’s mainly intended to support applications built on
newer CUDA Toolkits to run on systems installed with an older NVIDIA Linux GPU driver from
different major release families. This new forward-compatible upgrade path requires the use
of a special package called “CUDA compat package”.
The compat package will then be installed to the versioned toolkit location typically found in
the toolkit directory. For example, for 11.5 it will be found in /usr/local/cuda-11.5/.
The cuda-compat package consists of the following files:
These files should be kept together as the CUDA driver is dependent on the libnvidia-
ptxjitcompiler.so.* of the same version.
Note: This package only provides the files, and does not configure the system.
Example
CUDA Compatibility is installed and the application can now run successfully as shown below.
In this example, the user sets LD_LIBRARY_PATH to include the files installed by the cuda-
compat-11-5 package.
$ sudo apt-get install -y cuda-compat-11-5
Selecting previously unselected package cuda-compat-11-5.
(Reading database ... 220718 files and directories currently installed.)
Preparing to unpack .../cuda-compat-11-5_495.29.05-1_amd64.deb ...
Unpacking cuda-compat-11-5 (495.29.05-1) ...
Setting up cuda-compat-11-5 (495.29.05-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
The user can set LD_LIBRARY_PATH to include the files installed before running the CUDA 11.5
application:
$ LD_LIBRARY_PATH=/usr/local/cuda/compat:$LD_LIBRARY_PATH samples/bin/x86_64/linux/
release/deviceQuery
samples/bin/x86_64/linux/release/deviceQuery Starting...
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 11.5, CUDA Runtime Version
= 11.5, NumDevs = 1
Result = PASS
Note: Symlinks under /usr/local/cuda/compat need to be created manually when using the
runfile installer.
C - Compatible
X – Not compatible
* – New Feature Branches (such as 465.xx) are not supported targets for CUDA Forward
Compatibility.
‣ Shared deployment: Allows sharing the same compat package across installed toolkits
in the system. Download and extract the latest forward compatibility package with the
highest toolkit version in its name. Using RPATH, or through LD_LIBRARY_PATH or
through an automatic loader (for example. ld.so.conf), point to that package. This is the
most recommended choice.
The user can set LD_LIBRARY_PATH to include the files installed before running the CUDA
11.1 application:
$ LD_LIBRARY_PATH=/usr/local/cuda/compat:$LD_LIBRARY_PATH
‣ Per-application deployment: Individual applications can choose a package of their choice
and place it as part of the Modules system tied to the toolkit and the libraries. Using the
Modules system, the admin, or the user, can set up ‘module’ scripts for each version of
each toolkit package, and then load the module script for the toolkit as needed.
The CUDA driver maintains backward compatibility to continue support of applications built
on older toolkits. Using a compatible minor driver version, applications build on CUDA Toolkit
11 and newer are supported on any driver from within the corresponding major release.
Using the CUDA Forward Compatibility package, system administrators can run applications
built using a newer toolkit even when an older driver that does not satisfy the minimum
required driver version is installed on the system. This forward compatibility allows the CUDA
deployments in data centers and enterprises to benefit from the faster release cadence and
the latest features and performance of CUDA Toolkit.
CUDA compatibility helps users by:
‣ Faster upgrades to the latest CUDA releases: Enterprises or data centers with NVIDIA
GPUs have complex workflows and require advance planning for NVIDIA driver rollouts.
Not having to update the driver for newer CUDA releases can mean that new versions of
the software can be made available faster to users without any delays.
‣ Faster upgrades of the CUDA libraries: Users can upgrade to the latest software libraries
and applications built on top of CUDA (for example, math libraries or deep learning
frameworks) without an upgrade to the entire CUDA Toolkit or driver. This is possible as
these libraries and frameworks do not have a direct dependency on the CUDA runtime,
compiler or driver.
‣ What is the difference between CUDA forward compatible upgrade and CUDA minor
version compatibility? When should users use these features?
‣ If we build our CUDA application using CUDA 11.0, can it continue to be used with newer
NVIDIA drivers (e.g. CUDA 11.1/R455, 11.x etc.)? Or is it only the other way around?
Drivers have always been backwards compatible with CUDA. This means that a CUDA 11.0
application will be compatible with R450 (11.0), R455 (11.1) and beyond. CUDA applications
typically statically include all the libraries (for example cudart, CUDA math libraries
such as cuBLAS, cuFFT) they need, so they should work on new drivers or CUDA Toolkit
installations.
In other words, since CUDA is backward compatible, existing CUDA applications can
continue to be used with newer CUDA versions.
‣ What is the minimum CUDA 11.x driver that supports the CUDA minor version
compatibility?
The minimum driver version required is 450.80.02.
‣ What about new features introduced in minor releases of CUDA? How does a developer
build an application using newer CUDA Toolkits (e.g. 11.x) work on a system with a CUDA
11.0 driver (R450)?
By using new CUDA versions, users can benefit from new CUDA programming model APIs,
compiler optimizations and math library features.
‣ A subset of CUDA APIs don’t need a new driver and they can all be used without any
driver dependencies. For example, async copy APIs introduced in 11.1 do not need a
new driver.
‣ To use other CUDA APIs introduced in a minor release (that require a new driver), one
would have to implement fallbacks or fail gracefully. This situation is not different from
what is available today where developers use macros to compile out features based on
CUDA versions. Users should refer to the CUDA headers and documentation for new
CUDA APIs introduced in a release.
There are some issues that admins can advise the application developers to
accommodate in their code. Please refer to the Best Practices Guide for further
information.
‣ Does CUDA compatibility work with containers?
Yes. CUDA minor version compatibility and CUDA forward compatible upgrade both work
when using either NGC Deep Learning Framework containers or using containers that
are based on the official CUDA base images. The images include the CUDA compatible
upgrade libraries and the NVIDIA Container Toolkit (nvidia-docker2) has logic to correctly
load the required libraries.
‣ I’m running an NGC container and see this error: “This container was built for NVIDIA
Driver Release 450.51 or later, but version 418.126.02 was detected and compatibility
mode is UNAVAILABLE.”. What could be wrong?
It is possible you are either running a wrong version of the NVIDIA driver on the system or
your system does not have an NVIDIA Data Center GPU.
Copyright
© 2007-2022 NVIDIA Corporation and affiliates. All rights reserved.
NVIDIA Corporation | 2788 San Tomas Expressway, Santa Clara, CA 95051
https://www.nvidia.com
Notice
This document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation (“NVIDIA”) makes no representations or
warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assumes no responsibility for any errors contained herein. NVIDIA shall have no liability for the
consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material
(defined below), code, or functionality.
NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice.
Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete.
NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized
representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this
document. No contractual obligations are formed either directly or indirectly by this document.
NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can
reasonably be expected to result in personal injury, death, or property or environmental damage. NVIDIA accepts no liability for inclusion and/or use of NVIDIA products in such equipment or applications and therefore
such inclusion and/or use is at customer’s own risk.
NVIDIA makes no representation or warranty that products based on this document will be suitable for any specified use. Testing of all parameters of each product is not necessarily performed by NVIDIA. It is customer’s
sole responsibility to evaluate and determine the applicability of any information contained in this document, ensure the product is suitable and fit for the application planned by customer, and perform the necessary
testing for the application in order to avoid a default of the application or the product. Weaknesses in customer’s product designs may affect the quality and reliability of the NVIDIA product and may result in additional
or different conditions and/or requirements beyond those contained in this document. NVIDIA accepts no liability related to any default, damage, costs, or problem which may be based on or attributable to: (i) the use
of the NVIDIA product in any manner that is contrary to this document or (ii) customer product designs.
No license, either expressed or implied, is granted under any NVIDIA patent right, copyright, or other NVIDIA intellectual property right under this document. Information published by NVIDIA regarding third-party products
or services does not constitute a license from NVIDIA to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other
intellectual property rights of the third party, or a license from NVIDIA under the patents or other intellectual property rights of NVIDIA.
Reproduction of information in this document is permissible only if approved in advance by NVIDIA in writing, reproduced without alteration and in full compliance with all applicable export laws and regulations, and
accompanied by all associated conditions, limitations, and notices.
THIS DOCUMENT AND ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING
PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF
NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL NVIDIA BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT
LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS
DOCUMENT, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Notwithstanding any damages that customer might incur for any reason whatsoever, NVIDIA’s aggregate and cumulative
liability towards customer for the products described herein shall be limited in accordance with the Terms of Sale for the product.
VESA DisplayPort
DisplayPort and DisplayPort Compliance Logo, DisplayPort Compliance Logo for Dual-mode Sources, and DisplayPort Compliance Logo for Active Cables are trademarks owned by the Video Electronics Standards
Association in the United States and other countries.
HDMI
HDMI, the HDMI logo, and High-Definition Multimedia Interface are trademarks or registered trademarks of HDMI Licensing LLC.
OpenCL
OpenCL is a trademark of Apple Inc. used under license to the Khronos Group Inc.
Trademarks
NVIDIA and the NVIDIA logo are trademarks and/or registered trademarks of NVIDIA Corporation in the Unites States and other countries. Other company and product names may be trademarks of the respective
companies with which they are associated.
Copyright
© 2007-2022 NVIDIA Corporation and affiliates. All rights reserved.
NVIDIA Corporation | 2788 San Tomas Expressway, Santa Clara, CA 95051
https://www.nvidia.com