
    Vpf                    p    d dl m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dS )    )annotationsN)version)lib)
xla_bridgereturn
str | Nonec                 t    	 t          j        dg                                          S # t          $ r Y d S w xY w)Nz
nvidia-smi)
subprocesscheck_outputdecode	Exception     Y/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/jax/_src/environment_info.pytry_nvidia_smir      sH    "L>2299;;;	   44s   &) 
77Freturn_stringboolc                   t           j                            dd          }t          j        dd          5  t          t          j        t          j                                                            dd          }ddd           n# 1 swxY w Y   t          j
        dt          j         d	t          j         d
t          j         d| dt          j                     dt          j                     d| dt          j                     dt#          j                     d          }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.
  
       )	threshold	edgeitems Nz
  jax:    z
  jaxlib: z
  numpy:  z
  python: z
  jax.devices (z total, z	 local): z
  process_count: z
  platform: z

$ nvidia-smi
)sysr   replacenpprintoptionsstrarrayr   devicestextwrapdedent__version__r   version_strdevice_countlocal_device_countprocess_countplatformunamer   print)r   python_versiondevices_shortinfo
nvidia_smis        r   print_environment_infor1   "   s    ;&&tS11.	a000 J J!3!5!56677??bIIMJ J J J J J J J J J J J J J J	 ?  >  	 
 ')) 
 4>3P3R3R 
 ^k  *,,  ^  

 

$ * . :--D K;;s   AB

BB)r   r   )F)r   r   r   r   )
__future__r   r*   r
   r   r#   jaxr   jax._srcr   r   numpyr   r   r1   r   r   r   <module>r6      s    # " " " " "      



                                r   