{ "info": { "author": "Nathan Hunt", "author_email": "neighthan.hunt@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# GPU Utils\n\nA few small functions/scripts for working with GPUs.\n\n## Requirements\n\n* Python 3.6+\n* Linux OS for full functionality (only tested on Ubuntu; I use `subprocess.run` for `kill` and `lsof`)\n * Everything except `kill_interrupted_processes` should work on any OS\n\n## Installation\n\n```\npip install gpu-utils\n```\n\nThe PyPI page is [here][pypi page].\n\n## Usage\n\n```python\nfrom gpu_utils import gpu_init\n\n# sets GPU ids to use nvidia-smi ordering (CUDA_DEVICE_ORDER = PCI_BUS_ID)\n# finds the gpu with the most free utilization or memory\n# hides all other GPUs so you only use this one (CUDA_VISIBLE_DEVICES = )\ngpu_id = gpu_init(best_gpu_metric=\"util\") # could also use \"mem\"\n```\n\nIf you use TensorFlow or PyTorch, `gpu_init` can take care of another couple of steps for you:\n\n```python\n# a torch.device for the selected GPU\ndevice = gpu_init(ml_library=\"torch\")\n```\n\n```python\nimport tensorflow as tf\n# a tf.ConfigProto to allow soft placement + GPU memory growth\nconfig = gpu_init(ml_library=\"tensorflow\")\nsession = tf.Session(config=config)\n```\n\n## Command Line Scripts\n\n`gpu` is a more concise and prettier version of `nvidia-smi`. It is similar to [`gpustat`][gpustat] but with more control over the color configuration and the ability to show the full processes running on each GPU.\n\n`kill_interrupted_processes` is useful if you interrupt a process using a GPU but find that, even though `nvidia-smi` no longer shows the process, the memory is still being held. It will send `kill -9` to all such processes so you can reclaim your GPU memory.\n\n`tmux_gpu_info.py` just prints a list of the percent utilization of each GPU; you can, e.g., show this in the status bar of `tmux` to keep an eye on your GPUs.\n\n## Acknowledgements\n* Using `pynvml` instead of parsing `nvidia-smi` with regular expressions made this library a bit faster and much more robust than my previous regex parsing of `nivida-smi`'s output; thanks to [`gpustat`][gpustat] for showing me this library and some ideas about the output format for the `gpu` script.\n\n[pypi page]: https://pypi.org/project/gpu-utils/\n[gpustat]: https://github.com/wookayin/gpustat\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/neighthan/gpu-utils", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "gpu-utils", "package_url": "https://pypi.org/project/gpu-utils/", "platform": "", "project_url": "https://pypi.org/project/gpu-utils/", "project_urls": { "Homepage": "https://github.com/neighthan/gpu-utils", "Repository": "https://github.com/neighthan/gpu-utils" }, "release_url": "https://pypi.org/project/gpu-utils/0.2.8/", "requires_dist": [ "colored (>=1.3,<2.0)", "nvidia-ml-py3 (>=7.352,<8.0)", "psutil (>=5.6,<6.0)" ], "requires_python": ">=3.6,<4.0", "summary": "Utility functions for working with GPUs.", "version": "0.2.8" }, "last_serial": 5056575, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "391d572f6e581c75c0e615be877a547c", "sha256": "a6f6ac010e30bc4c3f0a3857d8642032e67ddd096958142765a38b2c4ececd0d" }, "downloads": -1, "filename": "gpu_utils-0.1.tar.gz", "has_sig": false, "md5_digest": "391d572f6e581c75c0e615be877a547c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3781, "upload_time": "2018-09-14T18:00:30", "url": "https://files.pythonhosted.org/packages/30/99/28d13ca4297414df075cc84ea01f17003429a111ad851e171d20b30885c9/gpu_utils-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6bdbcd166e30f67fa1153aafa0e7a3dd", "sha256": "6f306f11fe01949ad3237a1c6b17d63e0957218fd5279f4ef70589a734cda22a" }, "downloads": -1, "filename": "gpu_utils-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6bdbcd166e30f67fa1153aafa0e7a3dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4000, "upload_time": "2018-09-14T18:27:26", "url": "https://files.pythonhosted.org/packages/fb/2a/ccc3789c45bca37540cded24e86316512dc496997498144422291b25eadc/gpu_utils-0.1.1.tar.gz" } ], "0.1.1b0": [ { "comment_text": "", "digests": { "md5": "fbfbc7925ced8558fca15c2cc016f0b3", "sha256": "630261ac91c7050d971123f69dec81917dc58753a31528ef6b10e826d7a94208" }, "downloads": -1, "filename": "gpu_utils-0.1.1b0.tar.gz", "has_sig": false, "md5_digest": "fbfbc7925ced8558fca15c2cc016f0b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4010, "upload_time": "2018-09-14T18:32:16", "url": "https://files.pythonhosted.org/packages/55/2a/afea9b1937934d6fd7a5695ce1582661bc4a974a89a1dc9d6537c3f6d429/gpu_utils-0.1.1b0.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "558f0c06a03974049286e14832a90fd8", "sha256": "de869a207a623ca324a3e502084ebda97b0426b0b0dc80bac9a57e3f8fd7ac5d" }, "downloads": -1, "filename": "gpu_utils-0.1.2.tar.gz", "has_sig": false, "md5_digest": "558f0c06a03974049286e14832a90fd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3994, "upload_time": "2018-09-14T18:37:38", "url": "https://files.pythonhosted.org/packages/85/55/587d2d0d6b6cd8c110e8d92d74e5b32f2f6774f5d7f2954aea8fc09cc59b/gpu_utils-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "afe376ae6f505a39aa12541a5b3b7238", "sha256": "311bb82019143d78c4e965b5210d766b72a6f1d7f7946e3f0f88fa7aea6f4688" }, "downloads": -1, "filename": "gpu_utils-0.1.3.tar.gz", "has_sig": false, "md5_digest": "afe376ae6f505a39aa12541a5b3b7238", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4670, "upload_time": "2018-10-22T21:23:12", "url": "https://files.pythonhosted.org/packages/d0/a5/31c0db89f9270f3e1abeabdeff1f2dad3f8cda0a985222c03bf595d22d31/gpu_utils-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "08eb025de18b718462d495828014aaa8", "sha256": "cacc0f19dc1b7b2a108291424a8f4f0c59faaa981cbf9017c0a53017efffd863" }, "downloads": -1, "filename": "gpu_utils-0.1.4.tar.gz", "has_sig": false, "md5_digest": "08eb025de18b718462d495828014aaa8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5066, "upload_time": "2019-02-15T21:10:37", "url": "https://files.pythonhosted.org/packages/ae/1c/1b320b14b6073e58b4bf563508543c1c4b05c19a1bdc60841ecef4e16b2c/gpu_utils-0.1.4.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "70109dfe05cf8f11c6961fba982525d9", "sha256": "d4ea5697967fa2556553ac4ac0441c60c7be8b191fb0fc2edeb0811eefeef1da" }, "downloads": -1, "filename": "gpu_utils-0.2.0.tar.gz", "has_sig": false, "md5_digest": "70109dfe05cf8f11c6961fba982525d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6705, "upload_time": "2019-02-16T19:50:43", "url": "https://files.pythonhosted.org/packages/56/53/70672d5d1b7ce48f06d6a79dca3b1e2ba99b606d338246442dec9d57b56d/gpu_utils-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "b3fe5ba6c777ee8e5365afaaa1db6a65", "sha256": "226fad308e072c47e709fcad77e0fa15e9a5fa74b6f7c98895891b39f028c16a" }, "downloads": -1, "filename": "gpu_utils-0.2.1.tar.gz", "has_sig": false, "md5_digest": "b3fe5ba6c777ee8e5365afaaa1db6a65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6788, "upload_time": "2019-02-16T21:48:56", "url": "https://files.pythonhosted.org/packages/d7/f1/644aa548d4d6de4d2cd0c8048dce3ff3f48642872af47c7265aeda405176/gpu_utils-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "39777bcd4cc1aa49313c0cd8ebe6d449", "sha256": "a3c139a720bfd3fffab00b72fd63bd84f83dd5a6e9d7c4e35a9165df96e33615" }, "downloads": -1, "filename": "gpu_utils-0.2.2.tar.gz", "has_sig": false, "md5_digest": "39777bcd4cc1aa49313c0cd8ebe6d449", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6797, "upload_time": "2019-02-19T06:04:37", "url": "https://files.pythonhosted.org/packages/b6/19/2b35897d000876779fa2b2ff143f848a57bbb3db22eec21979ba08bb702e/gpu_utils-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "00ed8ee5120b967e15e4f0361611702e", "sha256": "7fe8c833e6716b74b1fb3d518f3ad781da2dcb9a451c45702a94d02cd3cda6cb" }, "downloads": -1, "filename": "gpu_utils-0.2.3-py3-none-any.whl", "has_sig": false, "md5_digest": "00ed8ee5120b967e15e4f0361611702e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 17245, "upload_time": "2019-03-07T17:12:23", "url": "https://files.pythonhosted.org/packages/ad/92/771cca9032f9794e5b919f5a4936a3ee83b647b72c12e10b57974ec09a26/gpu_utils-0.2.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c5e39ed3089135e68739ad3c52b7cf1c", "sha256": "eb7dd189e85f1b03dd8972d220109a547871e1fdf8d23bece282d87570a63094" }, "downloads": -1, "filename": "gpu-utils-0.2.3.tar.gz", "has_sig": false, "md5_digest": "c5e39ed3089135e68739ad3c52b7cf1c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 7531, "upload_time": "2019-03-07T17:12:25", "url": "https://files.pythonhosted.org/packages/2a/b0/46184edba104e04c22a8097ad8cd172c8a7c9488a80eb63f54aa898bc79e/gpu-utils-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "4e7511aa1730825e4b8fcbf865c5a715", "sha256": "ef1bb2bdc09c1fc82e2ca79f4ebe67691ee8cbc8dc845e02be930635c7d8e667" }, "downloads": -1, "filename": "gpu_utils-0.2.4-py3-none-any.whl", "has_sig": false, "md5_digest": "4e7511aa1730825e4b8fcbf865c5a715", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 17257, "upload_time": "2019-03-07T17:23:42", "url": "https://files.pythonhosted.org/packages/a9/2c/d4a8122188ffa5211ebbd560574c65de6819b05b2c90ce6c18d01b3a1811/gpu_utils-0.2.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fa0b2c90085641f3ef2f2b90d311da78", "sha256": "626bb07bb1e1f9e69937e5e0e75ae729b6b13286c9666e916db27f7c80ac56e1" }, "downloads": -1, "filename": "gpu-utils-0.2.4.tar.gz", "has_sig": false, "md5_digest": "fa0b2c90085641f3ef2f2b90d311da78", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 7548, "upload_time": "2019-03-07T17:23:44", "url": "https://files.pythonhosted.org/packages/43/b0/27d55c902a89e0ac601792fec982ba6832ea0f3271a917b18f9e38b2b4f6/gpu-utils-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "7bead8ea0e7c7bca5d9c7d0540fb16bc", "sha256": "9e76acaa0912f74cc783578906018da4c3e3e7e1886fdf6248ab2d8620a989af" }, "downloads": -1, "filename": "gpu_utils-0.2.5-py3-none-any.whl", "has_sig": false, "md5_digest": "7bead8ea0e7c7bca5d9c7d0540fb16bc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 18312, "upload_time": "2019-03-25T19:56:08", "url": "https://files.pythonhosted.org/packages/48/c9/1dfc2b63f572a3e0425fdcaa70457a2bd4be5241f38fb109dcd8cc8f677b/gpu_utils-0.2.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f8ee4510fc5bfd66b7a022895b0911dd", "sha256": "10824bb695696d2a71ab85bd4bdc9f1ecfc9d28a90131165073ff64ef128cdb7" }, "downloads": -1, "filename": "gpu-utils-0.2.5.tar.gz", "has_sig": false, "md5_digest": "f8ee4510fc5bfd66b7a022895b0911dd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8527, "upload_time": "2019-03-25T19:56:09", "url": "https://files.pythonhosted.org/packages/3d/e9/fd870ce54db74ed0290eb5378972dfe404d3f647c6d30b20811e1de15e30/gpu-utils-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "56f36e76f711511c460e45b897462655", "sha256": "9e41445819466de3f6aba64525783507a50c039ba0e8b4aa1dd0b0c0809d5faf" }, "downloads": -1, "filename": "gpu_utils-0.2.6-py3-none-any.whl", "has_sig": false, "md5_digest": "56f36e76f711511c460e45b897462655", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 18327, "upload_time": "2019-03-26T02:45:44", "url": "https://files.pythonhosted.org/packages/dc/f1/3c7eb7e605608524b3f408063582cd5f0463015fe2f29b5b0e303487b467/gpu_utils-0.2.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6d6f43bd53800b42a0799a2126a3e3a8", "sha256": "f7def72e155858a69cc6141747596399f4df1d9f1242b26b94ad9c9c8a5ca287" }, "downloads": -1, "filename": "gpu-utils-0.2.6.tar.gz", "has_sig": false, "md5_digest": "6d6f43bd53800b42a0799a2126a3e3a8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8523, "upload_time": "2019-03-26T02:45:45", "url": "https://files.pythonhosted.org/packages/5a/b6/339911c711687db1b5a9fb69554adb2d0174c733c2592aa545e50193898f/gpu-utils-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "741919a6c4a949658c0a77dcf36d66bc", "sha256": "c63a8c41ac39183601a85ac4a538d9f4a0b5f837a3200e4faaec8c1367995bbd" }, "downloads": -1, "filename": "gpu_utils-0.2.7-py3-none-any.whl", "has_sig": false, "md5_digest": "741919a6c4a949658c0a77dcf36d66bc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 18621, "upload_time": "2019-03-26T04:26:15", "url": "https://files.pythonhosted.org/packages/c4/7a/48b925f4872d273522c4fa1b222c1fcd9eed21867a8fb4e469cbeda22e7f/gpu_utils-0.2.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "08dca80f669b7bf66ae2ff4f879bde95", "sha256": "417d57734461845294c14c564e0a93c1e20ffb835e5f927b237bb3d6f987dbf4" }, "downloads": -1, "filename": "gpu-utils-0.2.7.tar.gz", "has_sig": false, "md5_digest": "08dca80f669b7bf66ae2ff4f879bde95", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8576, "upload_time": "2019-03-26T04:26:17", "url": "https://files.pythonhosted.org/packages/b6/9c/81cc5e62c5e3f8b504975f5c80663150cb4c6c7744fce4cd187f2c093fd8/gpu-utils-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "5bbdebeaca18d2a55e1883ec28de5e58", "sha256": "194f9bef98919cc5b172d6cb4bcd2ead4d4046100ac163a04b45d5f18371cd5c" }, "downloads": -1, "filename": "gpu_utils-0.2.8-py3-none-any.whl", "has_sig": false, "md5_digest": "5bbdebeaca18d2a55e1883ec28de5e58", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 18822, "upload_time": "2019-04-02T15:39:17", "url": "https://files.pythonhosted.org/packages/f5/c9/cc5472bfff07838247f242d1971e8cf44a564424164449138a70636a1ba1/gpu_utils-0.2.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91b38187aadbd75894e3c9f69699c059", "sha256": "566dc2081c36cc98cce58fbd2bfb055ea17f2d6a15161fd64391d5db36b57327" }, "downloads": -1, "filename": "gpu-utils-0.2.8.tar.gz", "has_sig": false, "md5_digest": "91b38187aadbd75894e3c9f69699c059", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8630, "upload_time": "2019-04-02T15:39:18", "url": "https://files.pythonhosted.org/packages/69/53/af7d3d4b8e68a09e64e179be09dc39cfd8e3792a60341d4a0c9b1ef7056d/gpu-utils-0.2.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5bbdebeaca18d2a55e1883ec28de5e58", "sha256": "194f9bef98919cc5b172d6cb4bcd2ead4d4046100ac163a04b45d5f18371cd5c" }, "downloads": -1, "filename": "gpu_utils-0.2.8-py3-none-any.whl", "has_sig": false, "md5_digest": "5bbdebeaca18d2a55e1883ec28de5e58", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 18822, "upload_time": "2019-04-02T15:39:17", "url": "https://files.pythonhosted.org/packages/f5/c9/cc5472bfff07838247f242d1971e8cf44a564424164449138a70636a1ba1/gpu_utils-0.2.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91b38187aadbd75894e3c9f69699c059", "sha256": "566dc2081c36cc98cce58fbd2bfb055ea17f2d6a15161fd64391d5db36b57327" }, "downloads": -1, "filename": "gpu-utils-0.2.8.tar.gz", "has_sig": false, "md5_digest": "91b38187aadbd75894e3c9f69699c059", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8630, "upload_time": "2019-04-02T15:39:18", "url": "https://files.pythonhosted.org/packages/69/53/af7d3d4b8e68a09e64e179be09dc39cfd8e3792a60341d4a0c9b1ef7056d/gpu-utils-0.2.8.tar.gz" } ] }