ó
    ¿²	jo  ã                  ó>   • S r SSKJr  SSKrSSKrSSKJr  SrSS jrg)uÿ  
Eagerly preload the CUDA 12 runtime shared libraries bundled by the
`nvidia-*-cu12` wheels so that `onnxruntime-gpu`'s `CUDAExecutionProvider`
can resolve them via `dlopen`.

Why this exists
---------------
`onnxruntime-gpu` (>=1.26.0) is built against CUDA 12. On hosts running
CUDA 13 (driver 580+) the system loader cannot find `libcublasLt.so.12`,
`libcudnn.so.9`, etc. â€” and `CUDAExecutionProvider` silently falls back
to CPU. The `nvidia-*-cu12` pip wheels install the libraries under
`<site-packages>/nvidia/<pkg>/lib/`, but the dynamic linker does not
search those paths by default and the wheels do not register them.

`ctypes.CDLL(path, RTLD_GLOBAL)` at import time makes the libraries'
symbols available to subsequent `dlopen` calls from onnxruntime, without
requiring callers to export `LD_LIBRARY_PATH`.

This is best-effort: a CPU-only environment without the `nvidia-*-cu12`
wheels installed will skip the preload silently. RapidOCR will then run
on CPU as before â€” extraction still works, just slower.
é    )ÚannotationsN)ÚPath)zlibcublasLt.so.12zlibcublas.so.12zlibcurand.so.10zlibcufft.so.11zlibcudart.so.12zlibcudnn.so.9c                 óÜ  • [        [        R                  5      S-  S[        R                  R                   S[        R                  R
                   3-  S-  n U S-  nUR                  5       (       d  / $ / n[         HZ  nUR                  U5       HB  n [        R                  " [        U5      [        R                  S9  UR                  U5          MX     M\     U$ ! [         a     MY  f = f)zßPreload CUDA 12 sonames from the `nvidia-*-cu12` pip wheels.

Returns the list of soname strings that were successfully loaded.
Silent on missing wheels (CPU-only environments) and on individual
`OSError`s during `dlopen`.
ÚlibÚpythonÚ.zsite-packagesÚnvidia)Úmode)r   ÚsysÚprefixÚversion_infoÚmajorÚminorÚis_dirÚ_CUDA_LIB_SONAMESÚrglobÚctypesÚCDLLÚstrÚRTLD_GLOBALÚappendÚOSError)Úsite_packagesÚnvidia_rootÚloadedÚsonameÚpaths        Ú6/home/mande/repo/quber/src/quber/utils/cuda_runtime.pyÚpreload_cuda_runtime_libsr   (   sâ   € ô 	ŒS�Z‰ZÓØ
ñ	à”3×#Ñ#×)Ñ)Ð*¨!¬C×,<Ñ,<×,BÑ,BÐ+CÐ
Dñ	Eð ñ	ð ð   (Ñ*€KØ×Ñ×ÑØˆ	à€Fß#ˆØ×%Ñ% fÖ-ˆDðÜ—’œC ›I¬F×,>Ñ,>Ò?Ø—‘˜fÔ%Úó	 .ñ $ð €Møô ó Úðús   Â=CÃ
C+Ã*C+)Úreturnz	list[str])	Ú__doc__Ú
__future__r   r   r   Úpathlibr   r   r   © ó    r   Ú<module>r&      s%   ðñõ. #ã Û 
Ý ðÐ õr%   