Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cuda.cudart.cudaRuntimeGetVersion() hard-codes the runtime version, rather than querying the runtime #16

@bdice

Description

@bdice

The current implementation of cuda.cudart.cudaRuntimeGetVersion() hard-codes the runtime version, rather than querying the runtime for its version. This results in incorrect runtime versions if the runtime version is different from the version of cuda-python.

cdef cudaError_t _cudaRuntimeGetVersion(int* runtimeVersion) nogil except ?cudaErrorCallRequiresNewerDriver:
cdef cudaError_t err
runtimeVersion[0] = m_global.CUDART_VERSION
return cudaSuccess

self.CUDART_VERSION = 11060

Additional context

A workaround used in rapidsai/rmm#946 is to use numba's API for this instead:

import numba.cuda

def cudaRuntimeGetVersion():
    major, minor = numba.cuda.runtime.get_version()
    return major * 1000 + minor * 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions