{"id":20631510,"url":"https://github.com/wilmerwang/gpusnatcher","last_synced_at":"2025-05-08T23:31:23.732Z","repository":{"id":55654315,"uuid":"296479256","full_name":"wilmerwang/GPUSnatcher","owner":"wilmerwang","description":"抢占显卡","archived":false,"fork":false,"pushed_at":"2024-10-10T10:58:51.000Z","size":36,"stargazers_count":64,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T19:21:18.580Z","etag":null,"topics":["pytorch","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wilmerwang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-18T01:12:34.000Z","updated_at":"2025-03-19T15:11:35.000Z","dependencies_parsed_at":"2025-01-26T05:10:39.998Z","dependency_job_id":"9d83a93e-a546-4871-a21a-25bf5fd79a47","html_url":"https://github.com/wilmerwang/GPUSnatcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilmerwang%2FGPUSnatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilmerwang%2FGPUSnatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilmerwang%2FGPUSnatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilmerwang%2FGPUSnatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilmerwang","download_url":"https://codeload.github.com/wilmerwang/GPUSnatcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253163682,"owners_count":21864123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pytorch","tensorflow"],"created_at":"2024-11-16T14:12:36.015Z","updated_at":"2025-05-08T23:31:23.712Z","avatar_url":"https://github.com/wilmerwang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPUSnatcher\n\nGPUSnatcher是用来在抢占显卡的脚本，主要是在实验室显卡资源紧张且自己亟需使用显卡的情况下，使用该脚本自动抢占一个或多个显卡。\n\n**建议将scramble4gpu.py更改为train.py，并设置仅自己可见，防止被打...**\n**请勿恶意抢占!!**\n\n## 依赖\n\n- numpy\n- torch or tensorflow\n\n## 使用\n\n- **请先配置Email，否则当抢占GPU之后，不能发送Email**\n```\ngit clone https://github.com/wilmerwang/GPUSnatcher.git\ncd GPUSnatcher\n\n# ./email_conf.json\n# 建议使用qq邮箱服务,如果用的其他邮箱服务器，请自行设置\n{\n  \"host\": \"smtp.qq.com\",  # qq邮箱server\n  \"user\": \"2xxxxxxx6@qq.com\",  # 要登陆的qq账号\n  \"pwd\": \"xxxxxxxxxxxxxxxx\",  # SMTP授权码, qq邮箱--\u003e 设置 --\u003e 账号 --\u003e IMAP/SMTP服务开启 --\u003e 生成授权码\n  \"sender\": \"2xxxxxxx6@qq.com\",  # 发送者\n  \"receiver\": \"2xxxxxxx6@qq.com\"  # 接收邮箱,可以是列表比如[\"a@qq.com\", \"b@qq.com\"]\n}\n```\n\n- 配置之后运行程序\n```shell\npython scramble4gpu.py\n```\n\n### 可选参数\n\n- -p --proportion 显卡空闲内存 / 全部内存 的阈值，取值在0-1之间。当p取1的时候，表示仅仅列出完全没有被使用的显卡。默认为0.8。\n- -n --gpu_nums 需要抢占的GPU数量，建议不要抢太多，容易挨揍。默认是1。\n- -t --times 抢占显卡之后，自动释放显卡的时间。默认是30分钟。\n- -e --email_conf email的配置参数，默认在./email_conf.json\n\n当想自己设置以上参数的时候：\n\n```shell\n# 查看参数详情\npython scramble4gpu.py -h\n\n# 查找Free显存大于0.9的显卡，抢占4个，1800秒后自动释放,email配置路径为./email_conf.json\npython scramble4gpu.py -p 0.9 -n 4 -t 1800 -e ./email_conf.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilmerwang%2Fgpusnatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilmerwang%2Fgpusnatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilmerwang%2Fgpusnatcher/lists"}