cudaErrorUnsupportedExecAffinity (802) cuda runtime_error ai_generated partial

CUDA error: unsupported exec affinity (cudaErrorUnsupportedExecAffinity)

ID: cuda/cuda-error-unsupported-exec-affinity

Also available as: JSON · Markdown · 中文
80%Fix Rate
84%Confidence
1Evidence
2025-01-12First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
CUDA 12.3 active
CUDA 12.5 active
NVIDIA Driver 545.23.06 active
NVIDIA Driver 550.54.10 active
PyTorch 2.4.0 active

Root Cause

The application requested a kernel execution affinity (e.g., via cudaLaunchAttributeCooperative or cudaFuncAttributeMaxDynamicSharedMemorySize) that is not supported by the current GPU architecture or driver version.

generic

中文

应用程序请求的内核执行亲和性(例如通过 cudaLaunchAttributeCooperative 或 cudaFuncAttributeMaxDynamicSharedMemorySize)不受当前 GPU 架构或驱动程序版本支持。

Official Documentation

https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html

Workarounds

  1. 85% success Check GPU compute capability and remove unsupported launch attributes. For example, cooperative launch requires sm >= 70: `deviceProp.major * 10 + deviceProp.minor >= 70`.
    Check GPU compute capability and remove unsupported launch attributes. For example, cooperative launch requires sm >= 70: `deviceProp.major * 10 + deviceProp.minor >= 70`.
  2. 80% success Upgrade to a driver that supports the required execution affinity (e.g., driver 550.54.10 or newer for CUDA 12.5 features).
    Upgrade to a driver that supports the required execution affinity (e.g., driver 550.54.10 or newer for CUDA 12.5 features).
  3. 90% success Fall back to a non-cooperative launch by setting `cudaLaunchAttributeCooperative` to 0: `cudaLaunchConfig config; config.attrs[cudaLaunchAttributeCooperative] = 0;`
    Fall back to a non-cooperative launch by setting `cudaLaunchAttributeCooperative` to 0: `cudaLaunchConfig config; config.attrs[cudaLaunchAttributeCooperative] = 0;`

中文步骤

  1. Check GPU compute capability and remove unsupported launch attributes. For example, cooperative launch requires sm >= 70: `deviceProp.major * 10 + deviceProp.minor >= 70`.
  2. Upgrade to a driver that supports the required execution affinity (e.g., driver 550.54.10 or newer for CUDA 12.5 features).
  3. Fall back to a non-cooperative launch by setting `cudaLaunchAttributeCooperative` to 0: `cudaLaunchConfig config; config.attrs[cudaLaunchAttributeCooperative] = 0;`

Dead Ends

Common approaches that don't work:

  1. 85% fail

    The error is about execution affinity attributes, not shared memory limits; increasing shared memory may cause other issues but does not resolve the affinity problem.

  2. 90% fail

    Synchronous execution does not affect launch attributes; the affinity check happens before the kernel is queued, regardless of blocking mode.