CUDA 13.4 samples update - v13.4-public

Release 13.4 of the CUDA Samples supported by CUDA Toolkit 13.4.
See Changelog for more information.
This commit is contained in:
Dheemanth
2026-09-09 15:07:08 -07:00
committed by GitHub
parent b7c5481c55
commit 5443602d89
871 changed files with 6843 additions and 321849 deletions

View File

@@ -72,15 +72,19 @@ verified on the host.
### Platform Support
The `ManagedMemoryResource` demo in this sample exercises **concurrent host
access** to managed allocations while the GPU is active, which requires the
device property `concurrent_managed_access=True`. This is only supported on
Linux with HMM (Pascal and newer). On Windows (WDDM/MCDM/TCC) the property
is `False`, so the sample exits early with a waive message and exit code
`2`. The `DeviceMemoryResource` + `PinnedMemoryResource` demos in this
sample would still work on Windows on their own, but to keep the sample
self-contained the entire script waives when concurrent managed access is
unavailable.
This sample needs two device capabilities, and exits with code `2` when
either is missing:
- `PinnedMemoryResource` is backed by a host memory pool, which requires
`host_memory_pools_supported=True`. Windows in TCC mode and older
integrated GPUs such as Jetson Orin report `False`.
- The `ManagedMemoryResource` demo builds host NumPy views over managed
allocations, which requires `concurrent_managed_access=True`. Windows
(WDDM/MCDM/TCC) and older integrated GPUs such as Jetson Orin report
`False`.
The demos are checked up front rather than individually to keep the sample
self-contained.
## Installation

View File

@@ -222,18 +222,23 @@ def main():
parser.add_argument("--device", type=int, default=0, help="CUDA device id")
args = parser.parse_args()
if sys.platform == "win32":
print(
"This sample relies on ManagedMemoryResource with concurrent host "
"access, which is not supported on Windows "
"(concurrent_managed_access=False). Waiving this sample."
)
sys.exit(2)
device = Device(args.device)
device.set_current()
print_gpu_info(device)
# PinnedMemoryResource is backed by a host memory pool, which is not
# available on every device.
if not device.properties.host_memory_pools_supported:
print("Host pinned memory pools are not supported on this platform.")
return 2
# This sample builds host NumPy views over managed memory. Devices without
# concurrent managed access keep managed allocations GPU-exclusive while
# the GPU is active, so those host views fault.
if not device.properties.concurrent_managed_access:
print("Concurrent managed memory access is not supported on this platform.")
return 2
stream = device.create_stream()
try: