Skip to content

[BUG]: cuda_bindings/examples globalToShmemAsyncCopy_test.py "catastrophic error" is masked by pytest skipped #730

Closed

Description

@rwgk

Is this a duplicate?

Type of Bug

Silent Failure

Component

cuda.bindings

Describe the bug

The "catastrophic error" below was overlooked in the the preparation for SWQA testing, because it's masked as skipped.

How to Reproduce

(WinDevVenv) PS C:\Users\rgrossekunst\forked\cuda-python-private\unreleased-13.0\cuda_bindings> python -m pytest -s -vv examples\
================================================= test session starts =================================================
platform win32 -- Python 3.13.5, pytest-8.4.1, pluggy-1.6.0 -- C:\Users\rgrossekunst\forked\cuda-python-private\unreleased-13.0\WinDevVenv\scripts\python.exe
cachedir: .pytest_cache
benchmark: 5.1.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: C:\Users\rgrossekunst\forked\cuda-python-private\unreleased-13.0\cuda_bindings\examples
configfile: pytest.ini
plugins: benchmark-5.1.0
collecting ... sourceCode.cu(2): catastrophic error: cannot open source file "cuda/barrier"
      #include <cuda/barrier>
                             ^

1 catastrophic error detected in the compilation of "sourceCode.cu".
Compilation terminated.

CUDA error code=6(b'NVRTC_ERROR_COMPILATION')
collected 1 item

examples\3_CUDA_Features\globalToShmemAsyncCopy_test.py::main SKIPPED (Automation filter against incompatible
kernel)

================================================= 1 skipped in 0.49s ==================================================

Expected behavior

We need to be more selective in catching and processing this kind of error.

Operating System

No response

nvidia-smi output

No response

Activity

  1. added
    bugSomething isn't working
    on Jun 26, 2025
  2. rwgk commented on Jun 26, 2025

    @rwgk
    ContributorAuthor

    This is what we have at the moment (globalToShmemAsyncCopy_test.py):

    def checkKernelCompiles():
        kernel_headers = """\
        #line __LINE__
        #if __CUDA_ARCH__ >= 700
        #include <cuda/barrier>
        #endif
        #include <cooperative_groups.h>
        #include <cooperative_groups/reduce.h>
        #include <cuda/pipeline>
        """
        try:
            common.KernelHelper(kernel_headers, findCudaDevice())
        except:
            # Filters out test from automation for two reasons
            # 1. Headers are not found
            # 2. Incompatible device
            return False
        return True
    

    In common.KernelHelper.__init__() near the top of the function:

            CUDA_HOME = os.getenv("CUDA_HOME")
            if CUDA_HOME is None:
                CUDA_HOME = os.getenv("CUDA_PATH")
            if CUDA_HOME is None:
                raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set")
    
  3. rwgk commented on Jun 26, 2025

    @rwgk
    ContributorAuthor

    Idea for making this less likely to mask actual errors:

    • If "Environment variable CUDA_HOME and CUDA_PATH are both not set":
      • either pytest error, or
      • pytest skipped with CUDA_HOME/CUDA_PATH not set as the SKIPPED message.
    • Otherwise (if CUDA_HOME is set):
      • Query the compute capability of the GPU, generate pytest skipped if too low

    In all other cases, to not skip the test, so that real errors can bubble up properly (pytest error).

  4. added
    P0High priority - Must do!
    cuda.bindingsEverything related to the cuda.bindings module
    on Jun 27, 2025
  5. rwgk commented on Jun 27, 2025

    @rwgk
    ContributorAuthor

    The idea in my previous comment was implemented on an internal branch, locally tested, and forwarded to SWQA for retesting.

  6. linked a pull request that will close this issueUpdate `cuda.bindings` to 13.0.0 #792on Aug 6, 2025
  7. leofang commented on Aug 6, 2025

    @leofang
    Member

    Closing, this is fixed as part of #792.

  8. moved this from Todo to Done in CCCLon Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0High priority - Must do!bugSomething isn't workingcuda.bindingsEverything related to the cuda.bindings module

Type

No type

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions