o
    Ďi	                     @   s*   d Z dd Zedkred e  dS dS )zOScript to check GPU availability for PyTorch in the current Python environment.c               
   C   sx  zddl } W n ty" } ztdt| W Y d}~dS d}~ww tdt| j td| j  | j rPtd| jj td| j	j
  tt| j }t|dkrdt|}t| |D ]}d	}z	| jj|d
}W n	 ty   Y nw td|| qlntd z| j	jjr| j	j rtd W t|S W t|S W t|S  ty   Y t|S w )zPrint diagnostic information about Torch/CUDA status, including Torch/CUDA
    versions and all available CUDA device names.
        NzLPyTorch unavailable, not running PyTorch tests. PyTorch import error was:
{}zTorch version: {}z)CUDA available (according to PyTorch): {}z'CUDA version (according to PyTorch): {}z(CuDNN version (according to PyTorch): {}zFound {} CUDA devices:unknown)devicez{}: {}zNo GPUs reported by PyTorchz<PyTorch reports that Metal Performance Shaders are available)torch	Exceptionprintformatstr__version__cudais_availableversionbackendscudnnlistrangedevice_countlenget_device_namempsis_built)r   e
device_idscuda_str	device_iddevice_name r   W/home/jeff/fluffinator/venv/lib/python3.10/site-packages/speciesnet/scripts/gpu_test.py
torch_test   sZ   



r   __main__z*** Running Torch tests ***
N)__doc__r   __name__r   r   r   r   r   <module>   s   0
