It is used to choose gpu to run for AI.
- Setup by hand:
python setup.py build
python setup.py install
- Setup by
pip
:
pip install managpu
- Import the package:
from managpu import GpuManager
- Create an entry:
my_gpu = GpuManager(visible_gpus)
-
Then choose gpus:
-
Choose in terms of free memory:
res = my_gpu.set_by_memory(top_k, limited_gpu_util)
-
Choose specific gpus:
res = my_gpu.set_specified_gpu(gpus)
-