{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/77088077","id":77088077,"diff_hunk":"@@ -0,0 +1,64 @@\n+# Add NVIDIA GPU discovery and assignment capabilities to Kubelet.\n+\n+## Background:\n+\n+So far we only support 1 GPU(```/dev/nvidia0```) and the GPU device need to be configured as a Kubelet's parameter manually. But in production environment, there could have multiple GPUs(```/dev/nvidia0, /dev/nvidia1, /dev/nvidia2 ...```) installed on 1 Minion, also 1 micro service could needs more than 1 GPU, and there could have thousands of Minions which means if Kubelet could discover GPU by itself would be great.\n+\n+\n+## Goal:\n+\n+ - Have the capabilities of GPU discovery to let Kubelet could aware more than 1 NVIDIA GPU and make the deployment easier.\n+ - Assign more than 1 GPU to 1 container to make the micro service with multiple GPUs requirement run on Kubernetes possible.\n+ - Add a general GPU interface for all the GPU vendors for future use.\n+\n+\n+## Implementation:\n+\n+### Limitation:\n+\n+In this implementation, we still only schedule dedicated NVIDIA GPU and NVIDIA GPU supported only, and will not be NVIDIA GPU details(familiies, cores, memory) sensitive.\n+\n+### Features:\n+\n+We need to add below features to enhance GPU(especial NVIDIA GPU) capabilities.\n+\n+ 1. Discover all the NVIDIA GPUs on a Minion. Without the NVIDIA GPU details information(families, cores, memory) needed, we can simply use regex to discover all the ```/dev/nvidiaN``` devices, so the NVML(NVIDIA Management Library) won't be necessary, but in the future if we want to schedule/assign GPU cores/memories the NVML libs is unavoidable.\n+  \n+\t1.1 Kubelet needs a list of GPU information, also need to report the number of free and total GPUs. Each general GPU device could be like:\n+    ```go\n+    type GPUDevice struct {\n+\t   ContainerName string\t\t // Which container this GPU attached. If it's NULL, the Status can't be Free.\n+\t   Path          string\t\t // The GPU path, like /dev/nvidia0, /dev/nvidia1, /dev/nvidia2...\n+\t   Status        string    // InUse/Free/Unknow. If it's InUse, must has a container name.\n+    }\n+    ```\n+  \n+\t1.2 Once Kubelet restart, the GPU information needs to be recovered from containers' imformation.\n+\n+ 2. Assign more than 1 NVIDIA GPU to 1 container, and each container could have multiple NVIDIA GPUs. The devices host/container mapping also need to be added to the runtime information, just as the volume did.\n+  \n+\t2.1 Kubelet need to find a the free GPU from the ```GPUDevice``` list, and asssign them to container. The device path on host and container are the same, like if we assgin ```/dev/nvidia1``` and ```/dev/nvidia2``` to a container, inside the container, we can see ```/dev/nvidia1``` and ```/dev/nvidia2``` as the same as on the host.\n+  \n+\t2.2 Once a container dead/be killed, the GPUs attached to this container need to be set free.","path":"docs/proposals/nvidia-gpu-enhancement.md","position":42,"original_position":42,"commit_id":"27bdbc68df0d950007f58f03bc6fdcbcf0cdd913","original_commit_id":"27bdbc68df0d950007f58f03bc6fdcbcf0cdd913","user":{"login":"Hui-Zhi","id":11676923,"avatar_url":"https://avatars.githubusercontent.com/u/11676923?v=3","gravatar_id":"","url":"https://api.github.com/users/Hui-Zhi","html_url":"https://github.com/Hui-Zhi","followers_url":"https://api.github.com/users/Hui-Zhi/followers","following_url":"https://api.github.com/users/Hui-Zhi/following{/other_user}","gists_url":"https://api.github.com/users/Hui-Zhi/gists{/gist_id}","starred_url":"https://api.github.com/users/Hui-Zhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hui-Zhi/subscriptions","organizations_url":"https://api.github.com/users/Hui-Zhi/orgs","repos_url":"https://api.github.com/users/Hui-Zhi/repos","events_url":"https://api.github.com/users/Hui-Zhi/events{/privacy}","received_events_url":"https://api.github.com/users/Hui-Zhi/received_events","type":"User","site_admin":false},"body":"Yes, the gpus are not released unless until the containers enter a terminal state.\r\n\r\nKubelet only cleanup the GPU state maintained by itself ```InUse/Free/Unknow```, do nothing to the inside GPU state.","created_at":"2016-08-31T22:52:03Z","updated_at":"2016-08-31T22:52:03Z","html_url":"https://github.com/kubernetes/kubernetes/pull/30756#discussion_r77088077","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30756","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/77088077"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/30756#discussion_r77088077"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30756"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30756","id":81602872,"html_url":"https://github.com/kubernetes/kubernetes/pull/30756","diff_url":"https://github.com/kubernetes/kubernetes/pull/30756.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/30756.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/30756","number":30756,"state":"open","locked":false,"title":"add nvidia-gpu-enhancement.md pr","user":{"login":"Hui-Zhi","id":11676923,"avatar_url":"https://avatars.githubusercontent.com/u/11676923?v=3","gravatar_id":"","url":"https://api.github.com/users/Hui-Zhi","html_url":"https://github.com/Hui-Zhi","followers_url":"https://api.github.com/users/Hui-Zhi/followers","following_url":"https://api.github.com/users/Hui-Zhi/following{/other_user}","gists_url":"https://api.github.com/users/Hui-Zhi/gists{/gist_id}","starred_url":"https://api.github.com/users/Hui-Zhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hui-Zhi/subscriptions","organizations_url":"https://api.github.com/users/Hui-Zhi/orgs","repos_url":"https://api.github.com/users/Hui-Zhi/repos","events_url":"https://api.github.com/users/Hui-Zhi/events{/privacy}","received_events_url":"https://api.github.com/users/Hui-Zhi/received_events","type":"User","site_admin":false},"body":"**This PR is for NVIDIA GPU capabilities enhancement**.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.kubernetes.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30756)\n<!-- Reviewable:end -->\n","created_at":"2016-08-17T08:30:44Z","updated_at":"2016-08-31T22:52:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05af19bdb87248a58b0efd4c8ea19bb936db8c90","assignee":{"login":"erictune","id":8105590,"avatar_url":"https://avatars.githubusercontent.com/u/8105590?v=3","gravatar_id":"","url":"https://api.github.com/users/erictune","html_url":"https://github.com/erictune","followers_url":"https://api.github.com/users/erictune/followers","following_url":"https://api.github.com/users/erictune/following{/other_user}","gists_url":"https://api.github.com/users/erictune/gists{/gist_id}","starred_url":"https://api.github.com/users/erictune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictune/subscriptions","organizations_url":"https://api.github.com/users/erictune/orgs","repos_url":"https://api.github.com/users/erictune/repos","events_url":"https://api.github.com/users/erictune/events{/privacy}","received_events_url":"https://api.github.com/users/erictune/received_events","type":"User","site_admin":false},"assignees":[{"login":"erictune","id":8105590,"avatar_url":"https://avatars.githubusercontent.com/u/8105590?v=3","gravatar_id":"","url":"https://api.github.com/users/erictune","html_url":"https://github.com/erictune","followers_url":"https://api.github.com/users/erictune/followers","following_url":"https://api.github.com/users/erictune/following{/other_user}","gists_url":"https://api.github.com/users/erictune/gists{/gist_id}","starred_url":"https://api.github.com/users/erictune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictune/subscriptions","organizations_url":"https://api.github.com/users/erictune/orgs","repos_url":"https://api.github.com/users/erictune/repos","events_url":"https://api.github.com/users/erictune/events{/privacy}","received_events_url":"https://api.github.com/users/erictune/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30756/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30756/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/30756/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/27bdbc68df0d950007f58f03bc6fdcbcf0cdd913","head":{"label":"Hui-Zhi:gpu-enhance-pr","ref":"gpu-enhance-pr","sha":"27bdbc68df0d950007f58f03bc6fdcbcf0cdd913","user":{"login":"Hui-Zhi","id":11676923,"avatar_url":"https://avatars.githubusercontent.com/u/11676923?v=3","gravatar_id":"","url":"https://api.github.com/users/Hui-Zhi","html_url":"https://github.com/Hui-Zhi","followers_url":"https://api.github.com/users/Hui-Zhi/followers","following_url":"https://api.github.com/users/Hui-Zhi/following{/other_user}","gists_url":"https://api.github.com/users/Hui-Zhi/gists{/gist_id}","starred_url":"https://api.github.com/users/Hui-Zhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hui-Zhi/subscriptions","organizations_url":"https://api.github.com/users/Hui-Zhi/orgs","repos_url":"https://api.github.com/users/Hui-Zhi/repos","events_url":"https://api.github.com/users/Hui-Zhi/events{/privacy}","received_events_url":"https://api.github.com/users/Hui-Zhi/received_events","type":"User","site_admin":false},"repo":{"id":47675473,"name":"kubernetes","full_name":"Hui-Zhi/kubernetes","owner":{"login":"Hui-Zhi","id":11676923,"avatar_url":"https://avatars.githubusercontent.com/u/11676923?v=3","gravatar_id":"","url":"https://api.github.com/users/Hui-Zhi","html_url":"https://github.com/Hui-Zhi","followers_url":"https://api.github.com/users/Hui-Zhi/followers","following_url":"https://api.github.com/users/Hui-Zhi/following{/other_user}","gists_url":"https://api.github.com/users/Hui-Zhi/gists{/gist_id}","starred_url":"https://api.github.com/users/Hui-Zhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hui-Zhi/subscriptions","organizations_url":"https://api.github.com/users/Hui-Zhi/orgs","repos_url":"https://api.github.com/users/Hui-Zhi/repos","events_url":"https://api.github.com/users/Hui-Zhi/events{/privacy}","received_events_url":"https://api.github.com/users/Hui-Zhi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Hui-Zhi/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/Hui-Zhi/kubernetes","forks_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/forks","keys_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/teams","hooks_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/events","assignees_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/tags","blobs_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/languages","stargazers_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/subscription","commits_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/merges","archive_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/downloads","issues_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/Hui-Zhi/kubernetes/deployments","created_at":"2015-12-09T07:22:44Z","updated_at":"2016-06-22T06:59:53Z","pushed_at":"2016-08-22T05:55:37Z","git_url":"git://github.com/Hui-Zhi/kubernetes.git","ssh_url":"git@github.com:Hui-Zhi/kubernetes.git","clone_url":"https://github.com/Hui-Zhi/kubernetes.git","svn_url":"https://github.com/Hui-Zhi/kubernetes","homepage":"http://kubernetes.io","size":305025,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"68327f76bfb24b62b36860514d77998c27f81703","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-08-31T21:15:21Z","pushed_at":"2016-08-31T22:45:32Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":554292,"stargazers_count":16449,"watchers_count":16449,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5307,"mirror_url":null,"open_issues_count":4370,"forks":5307,"open_issues":4370,"watchers":16449,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30756"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/30756"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/30756"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/30756/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30756/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30756/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/27bdbc68df0d950007f58f03bc6fdcbcf0cdd913"}}}}
{"actor":{"display_login":"Hui-Zhi"}}