Skip to content

CUDA 13.x API compatibility - #490

Open
MozillaFiredoge wants to merge 2 commits into
NVIDIA-Omniverse:mainfrom
MozillaFiredoge:fix-cuda-13-2
Open

CUDA 13.x API compatibility#490
MozillaFiredoge wants to merge 2 commits into
NVIDIA-Omniverse:mainfrom
MozillaFiredoge:fix-cuda-13-2

Conversation

@MozillaFiredoge

@MozillaFiredoge MozillaFiredoge commented May 20, 2026

Copy link
Copy Markdown

Summary

This PR updates the PhysX GPU source build for CUDA 13.x compatibility.

CUDA Toolkit 13.0 removed offline compilation and library support for pre-Turing architectures, including Volta / sm_70, so the default GPU architecture list should no longer emit sm_70 SASS when building with CUDA 13.x.

CUDA 13.x also changed several generated host-side CUDA entry points and Driver API signatures used by the PhysX GPU build. Since PhysX intentionally avoids linking against CUDART and provides local CUDA runtime stubs in CudaKernelWrangler.cpp, this PR adds the missing CUDA 13.x runtime stub symbols instead of linking cudart_static.

Changes

  • Keep sm_70 SASS generation when building with CUDA 12.x.
  • Exclude sm_70 only when building with CUDA 13.x or newer, because CUDA 13.0 removed offline compilation support for pre-Turing architectures.
  • Add CUDA 13.x runtime shim symbols used by generated host stubs:
    • __cudaLaunchKernel
    • __cudaGetKernel
  • Update the cuCtxCreate call for the CUDA 13.x Driver API signature.

Motivation

When building PhysXGpu with CUDA Toolkit 13.2 on Windows / MSVC, the build currently fails with unresolved external symbols emitted by CUDA-generated host stubs, for example:

unresolved external symbol __cudaLaunchKernel
unresolved external symbol __cudaGetKernel

Linking against cudart_static is not a suitable fix because CudaKernelWrangler.cpp already defines several CUDA runtime shim symbols, which causes duplicate symbol errors such as __cudaRegisterFatBinary, __cudaRegisterFunction, and cudaLaunchKernel.

Keeping these symbols in CudaKernelWrangler.cpp preserves the existing PhysX design of resolving CUDA-generated runtime dependencies without linking the full CUDA runtime.

Validation

Tested locally with:

  • Windows
  • Visual Studio 2022 / vc17win64
  • CUDA Toolkit 13.2
  • PhysX GPU source build
  • PhysXGpu builds past the previous CUDA 13.x link errors

@MozillaFiredoge
MozillaFiredoge force-pushed the fix-cuda-13-2 branch 2 times, most recently from 6a33c19 to 82bdd22 Compare May 20, 2026 14:05
Signed-off-by: Firedoge <201348850@qq.com>
Signed-off-by: Firedoge <201348850@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant