Skip to content

Instantly share code, notes, and snippets.

View dizcza's full-sized avatar
🏠

Danylo Ulianych dizcza

🏠
View GitHub Profile
@dizcza
dizcza / python-nvidia-smi.py
Last active May 25, 2020 09:16
set CUDA_VISIBLE_DEVICES env from available GPUs
import subprocess
import os
class GpuInfo(object):
def __init__(self, index, memory_total, memory_used, gpu_load):
"""
:param index: GPU index
:param memory_total: total GPU memory, Mb
:param memory_used: GPU memory already in use, Mb
/**
******************************************************************************
* File Name : main.c
* Description : Main program body
******************************************************************************
*
* COPYRIGHT(c) 2016 STMicroelectronics
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met: