o
    i]	                     @   s0   d dl Z d dlZd dlZdae Zdd ZdS )    NFc                  C   s   t rdS t t r	 W d   dS da W d   n1 sw   Y  tjdr+dS ddlm}  | j}|d }|  \}}|| j	j
krKtd| |d }||krgtjd| d	| d
| dtdd dS dS )a)  Warn if the CUDA driver major version is older than cuda-bindings compile-time version.

    This function compares the CUDA major version that cuda-bindings was compiled
    against with the CUDA major version supported by the installed driver. If the
    compile-time major version is greater than the driver's major version, a warning
    is issued.

    The check runs only once per process. Subsequent calls are no-ops.

    The warning can be suppressed by setting the environment variable
    ``CUDA_PYTHON_DISABLE_MAJOR_VERSION_WARNING=1``.
    NT)CUDA_PYTHON_DISABLE_MAJOR_VERSION_WARNINGr   )driveri  z%Failed to query CUDA driver version: z/cuda-bindings was built for CUDA major version z1, but the NVIDIA driver only supports up to CUDA z. Some cuda-bindings features may not work correctly. Consider updating your NVIDIA driver, or using a cuda-bindings version built for CUDA zM. (Set CUDA_PYTHON_DISABLE_MAJOR_VERSION_WARNING=1 to suppress this warning.)   )
stacklevel)$_major_version_compatibility_checked_lockosenvirongetcuda.bindingsr   CUDA_VERSIONcuDriverGetVersionCUresultCUDA_SUCCESSRuntimeErrorwarningswarnUserWarning)r   compile_versioncompile_majorerrruntime_versionruntime_major r   V/home/ubuntu/.local/lib/python3.10/site-packages/cuda/bindings/utils/_version_check.py#warn_if_cuda_major_version_mismatch   s8   
r   )r   	threadingr   r   Lockr   r   r   r   r   r   <module>   s   