Skip to content
Machine Learning
Skill

/cuda-interop

GPU interop patterns for CUDA arrays, timeline semaphores, Vulkan shared memory, and MIG-safe CUDA-to-Vulkan device matching. Use when user asks about CUDA interop, GPU rendering pipelines, Vulkan interop, shared memory, timeline semaphores, MIG, or multi-GPU output routing.

From plugin
ovrtx
27141 skills

Claude Code

$ npx -y skills add nvidia-omniverse/ovrtx --skill cuda-interop --agent claude-code

SKILL.md

cuda-interop.SKILL.md
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: CC-BY-4.0 AND Apache-2.0
name: cuda-interop
description: >
  GPU interop patterns for CUDA arrays, timeline semaphores, Vulkan shared memory,
  and MIG-safe CUDA-to-Vulkan device matching.
  Use when user asks about CUDA interop, GPU rendering pipelines, Vulkan interop,
  shared memory, timeline semaphores, MIG, or multi-GPU output routing.
license: CC-BY-4.0 AND Apache-2.0
author: NVIDIA ovrtx
tags:
  - ovrtx
  - cuda
  - interop
  - mig
  - multi-gpu
tools:
  - Read
  - Grep

CUDA Interop

When to Use

Use this skill when the user asks about CUDA interop, GPU rendering pipelines, Vulkan interop, shared memory, or timeline semaphores.

Inputs

Resolve inputs in this order: existing repository files and referenced snippets, explicit user request, then broader agent context.

  • Target API surface: Python, C/C++, USD, or a combination.
  • Interop path: render output to linear CUDA memory, render output to CUDA array, attribute mapping to CUDA, or Vulkan external memory.
  • RenderProduct/RenderVar or attribute target, CUDA device expectations, stream/event handles, and ownership boundaries.
  • Tensor/image shape, dtype, synchronization points, and whether the consumer expects linear memory or array/image memory.
  • Repository source snippets referenced below. Treat these snippets as the API source of truth.

Prerequisites

  • Use an ovrtx checkout that contains the referenced examples and docs tests.
  • Read the relevant `> **Source:**` snippet before writing or explaining API usage.
  • Confirm whether the requested path needs linear CUDA memory (`Device.CUDA` / `OVRTX_MAP_DEVICE_TYPE_CUDA`), a CUDA array (`Device.CUDA_ARRAY` / `OVRTX_MAP_DEVICE_TYPE_CUDA_ARRAY`), or Vulkan shared memory.
  • Use `reading-render-output` for CPU readback or non-interop render output mapping.

Instructions

1. Identify whether the workflow maps render output to CUDA memory, maps output to a CUDA array, writes attributes from CUDA memory, or coordinates CUDA with Vulkan. 2. Read the source snippet for the exact map/unmap path before choosing between linear CUDA memory and a CUDA array; both selectors exist in C (`OVRTX_MAP_DEVICE_TYPE_CUDA`, `OVRTX_MAP_DEVICE_TYPE_CUDA_ARRAY`) and in Python (`Device.CUDA`, `Device.CUDA_ARRAY`). 3. Preserve the synchronization contract: wait on ovrtx-provided CUDA events before reading unless enqueueing directly on an available borrowed producer stream, record CUDA work completion events before unmapping, and use `sync_stream` only for the auto-sync path. 4. For Vulkan interop, keep external-memory ownership, timeline semaphore ordering, and presentation-ring lifetimes aligned with the full `vulkan-interop` example. 5. When changing code, run the CUDA render-output or Vulkan interop example/test that owns the snippet whenever practical. 6. Select a Vulkan device by comparing `cuDeviceGetUuid_v2()` for the configured or mapped CUDA ordinal with `VkPhysicalDeviceIDProperties::deviceUUID`. Do not use PCI identity, `cudaDeviceProp::uuid`, or legacy `cuDeviceGetUuid()` for MIG selection.

Output Format

  • For explanations, cite the relevant API names, source snippets, and caveats.
  • For code changes, summarize the files changed, snippets affected, and validation run.

Scripts

This skill has no scripts.

Limitations

  • The referenced snippets remain the source of truth; update or add tested snippets before documenting new API usage.
  • On Linux, the CUDA stream/event synchronization in this skill is subject to a known driver scheduling interaction. Windows is unaffected. Refer to `docs/core/cuda_vulkan_scheduling.rst`.

Overview

ovrtx renders on the GPU and can provide output as CUDA device memory or as a CUDA array (zero-copy). Both are reachable from C and from Python. For advanced pipelines (e.g., Vulkan display, custom CUDA post-processing), you need to handle CUDA synchronization correctly to avoid race conditions between ovrtx's internal GPU work and your own.

Python

Experimental producer-stream handoff

Uniform zero-copy GPU mappings may expose `MappedRenderVar.producer_stream` (C: `ovrtx_render_var_output_t::cuda_sync.stream`). This is a borrowed enqueue target, not an additional readiness dependency. Consumers using the readiness event must ignore the output stream rather than synchronize it as well.

Map with `sync_stream=0` to avoid Python's default map-time legacy-stream event wait. Queue short read-only work on the borrowed stream in the tensor device's primary CUDA context, without an additional readiness wait. Work follows everything already queued on that stream, including later products, the end of the render graph, and already-submitted subsequent steps. This gives up per-product readiness, even when `wait_event` identifies a per-product event; the same rule applies to the per-device fallback. Keep the mapping alive through consumer completion and provide completion synchronization at unmap. The mapping does not retain the stream; serialize use with render-graph rebuild, reset, and destruction and finish reads before those operations. Never destroy, configure, capture, or cache this stream. CPU, copied, compressed, and composite mappings retain the event-based path.

Map render output to CUDA

> **Source:** `tests/docs/python/test_camera_sensors.py` snippet `doc-map-render-output-cuda`

Map attribute to CUDA for Warp kernel writes

> **Source:** `tests/docs/python/test_attribute_bindings.py` snippet `doc-map-attribute-cuda`

Map render output as CUDA array (zero-copy)

`device=Device.CUDA_ARRAY` takes the same zero-copy image path as the C API: ovrtx hands back the render target's CUDA array instead of copying it into linear memory. The array is an opaque image handle, so the DLTensor reports an opaque-handle dtype and **no DLPack consumer can read it** — `np.from_dlpack(rv)`, `.numpy()`, and War

Read more
@nvidia-omniverse
Ships withovrtx

ovrtx is a C and Python library for embedding Omniverse RTX sensor simulation and visualization directly into applications.

Stars on GitHub

Momentum

stars in total
271
Star history of nvidia-omniverse/ovrtx on GitHub, a chart by star-history.com

Other skills on ovrtx.

application-flow

application-flow

High-level overview of a typical ovrtx application lifecycle. Use when user asks how to structure an ovrtx program, what the main…

async-operations

async-operations

Asynchronous operation patterns including polling, timeouts, and non-blocking workflows. Use when user asks about async…

attribute-bindings

attribute-bindings

Replacing persistent ovrtx attribute bindings with reusable ovstage queries for repeated writes or maps. Use when user asks about…

binding-materials

binding-materials

Binding materials to prims at runtime. Use when user asks to assign a material, change a material, set material binding, or swap…

camera-outputs-rt2

camera-outputs-rt2

Available camera render outputs for Real-Time Path Tracing (RT2) mode. Use when user asks what AOVs/render vars are available,…

cloning-prims

cloning-prims

Cloning USD subtrees to create copies at new paths. Use when user asks to clone, duplicate, copy a prim, or create instances of…

More skills from other plugins.

analyze-ci

analyze-ci

Analyze failed GitHub Action jobs. Takes one or more GitHub URLs (job, workflow-run, or PR) and summarizes each failure with root…

mlflow8d29k
@mlflow@mlflowInstall Skill
hf-cli

hf-cli

Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and…

skills3w11k
@huggingface@huggingfaceInstall Skill
feast-architecture

feast-architecture

Internals of the Feast codebase — how each component works, where the key abstractions live, and the data flow through the…

feast12d7.4k
@feast-dev@feast-devInstall Skill
add-ecosystem

add-ecosystem

Add a new ecosystem and base model to basemodel.constants.ts. Use when onboarding a new model family from providers like Baidu,…

civitai9d7.3k
@civitai@civitaiInstall Skill

Questions about cuda-interop.

Which coding agents can use cuda-interop?
cuda-interop installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.