<jupyter_start><jupyter_text>Get GPU devicesWe are using here undocumended functions to get list of local devices and filter them by type equal to `GPU`.If GPU connected correctly to TenstoFlow it should see it in result<jupyter_code>from tensorflow.python.client import device_lib

def get_available_gpus():
    local_device_protos = device_lib.list_local_devices()
    return [x.name for x in local_device_protos if x.device_type == 'GPU']

get_available_gpus()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06490872210953347, 'fraction_numerical': 0.0, 'mean_word_length': 6.264705882352941, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '506732', 'license': 'MIT', 'n_tokens_mistral': 153, 'n_tokens_neox': 152, 'n_words': 50, 'path': 'get-gpu-devices.ipynb', 'repo_name': 'hyzhak/cpu-vs-gpu', 'size': '493'}