Skip to content

Handle Windows TCC/WDDM mode more robustly #206

Closed
2 of 2 issues completed
Closed

Description

@leofang

This issue tracks an internal discussion with QA. This simple snippet shows why using cuda.core today on Windows might fail, depending on if it's TCC or WDDM mode:

>>> from cuda import cuda, cudart
>>> print(cudart.cudaGetDevice())
(<cudaError_t.cudaSuccess: 0>, 0)
>>> print(cuda.cuDeviceGetMemPool(0))
(<CUresult.CUDA_ERROR_NOT_SUPPORTED: 801>, <CUmemoryPool 0x0>)

cuda.core currently assumes the stream-ordered memory allocator is available. However, CUDA on Windows is a bit more complicated than on Linux, since there are two operation modes:

  • In the WDDM mode (which is the case during cuda.core development), things should work just fine.
  • In the TCC mode (as reported by QA), this is unsupported

We need some treatments to make it usable on TCC.

Activity

  1. added
    cuda.coreEverything related to the cuda.core module
    enhancementAny code-related improvements
    P0High priority - Must do!
    on Nov 1, 2024
  2. added this to the cuda.core beta 2 milestone on Nov 1, 2024
  3. changed the title [-]Handle WIndows TCC/WDDM mode more robustly[/-] [+]Handle Windows TCC/WDDM mode more robustly[/+] on Nov 1, 2024
  4. jrhemstad commented on Nov 1, 2024

    @jrhemstad

    Can't we just say the pool is not available on Windows in TCC mode? I don't think we need to go above and beyond to support something the driver doesn't support.

  5. leofang commented on Nov 1, 2024

    @leofang
    MemberAuthor

    It is not appropriate because CUDA does support Windows TCC mode, just not the mempool. Right now cuda.core is not functional at all only because I forgot (😞) mempools are not there, but we can easily provide a fallback path to make it work (by wrapping cudaMalloc/cudaFree as suggested in #208).

    @jrhemstad I suggest us to take this seriously if we want CUDA Mode to succeed, as we have many Windows TCC users in the LLM space, and they all hit this issue (it only took me 1 min to quickly google these):

  6. leofang commented on Nov 12, 2024

    @leofang
    MemberAuthor

    #209 is related (the 3rd step we should take in the future to address this issue).

  7. removed this from the cuda.core beta 2 milestone on Nov 15, 2024
  8. leofang commented on Nov 25, 2024

    @leofang
    MemberAuthor

    Another reason that TCC is important is because it's the default of GHA Windows GPU runner, e.g.:
    https://github.com/cupy-ci-poc/cupy/actions/runs/12004661559/job/33459987560#step:5:15

  9. added this to the cuda.core beta 2 milestone on Dec 29, 2024
  10. leofang commented on Dec 29, 2024

    @leofang
    MemberAuthor

    Closing this as it's working for TCC now. As mentioned above the potential improvement is tracked in #209.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priority - Must do!cuda.coreEverything related to the cuda.core moduleenhancementAny code-related improvements

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions