
    vh                    v    d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ d dl	m
Z
 d dl	mZ d dlZddZd	d
dZy)    )annotationsN)version)lib)
xla_bridgec                 j    	 t        j                  dg      j                         S # t        $ r Y y w xY w)Nz
nvidia-smi)
subprocesscheck_outputdecode	Exception     T/opt/face_recognition/venv/lib/python3.12/site-packages/jax/_src/environment_info.pytry_nvidia_smir      s5    ""L>299;;	 s   #& 	22c                   t         j                  j                  dd      }t        j                  dt        j
                   dt        j                   dt        j
                   d| dt        j                         d   j                   d	t        j                          d
t        j                          dt        j                          dt        j                                 }t"        j$                  j'                         D ]"  \  }}|j)                  d      s|d| d| z  }$ t+               }|r|d|z   z  }| r|S t-        |      S )zReturns a string containing local environment & JAX installation information.

  This is useful information to include when asking a question or filing a bug.

  Args: return_string (bool) : if True, return the string rather than printing
  to stdout.
  
 z
  jax:    z
  jaxlib: z
  numpy:  z
  python: z
  device info: r   -z, z! local devices"
  process_count: z
  platform: JAX_=z

$ nvidia-smi
)sysr   replacetextwrapdedent__version__r   version_strnpxbdevicesdevice_kinddevice_countlocal_device_countprocess_countplatformunameosenvironitems
startswithr   print)return_stringpython_versioninfokeyvalue
nvidia_smis         r   print_environment_infor0   #   s;    ;;&&tS1.	 
  ??
 >>
 
 

Q++,Aboo.?-@2CXCXCZB[ \""$% &^^" 
#$ JJ$$& !jc5
~~f
3%q  d! * :--DK;r   )return
str | None)F)r*   boolr1   r2   )
__future__r   r%   r#   r   r   r   jaxr   jax._srcr   r   r   numpyr   r   r0   r   r   r   <module>r8      s/    # 	   
    % r   