Skip to content

Instantly share code, notes, and snippets.

View cozek's full-sized avatar
🤕

Kaushik Amar Das cozek

🤕
View GitHub Profile
def get_gpu_with_highest_free_memory():
"""
Returns the index of the GPU with the highest free memory.
This function sorts the GPUs by PCI bus ID and then returns the index of the GPU with the highest free memory.
Returns:
list: A list containing the index and free memory of the GPU with the highest free memory.
Notes: