{"action":"created","issue":{"url":"https://api.github.com/repos/torch/cutorch/issues/130","labels_url":"https://api.github.com/repos/torch/cutorch/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/torch/cutorch/issues/130/comments","events_url":"https://api.github.com/repos/torch/cutorch/issues/130/events","html_url":"https://github.com/torch/cutorch/issues/130","id":67390848,"number":130,"title":"getDeviceProperties(gpuid).freeGlobalMem doesn't take the GPU id into account","user":{"login":"fmassa","id":9110200,"avatar_url":"https://avatars.githubusercontent.com/u/9110200?v=3","gravatar_id":"","url":"https://api.github.com/users/fmassa","html_url":"https://github.com/fmassa","followers_url":"https://api.github.com/users/fmassa/followers","following_url":"https://api.github.com/users/fmassa/following{/other_user}","gists_url":"https://api.github.com/users/fmassa/gists{/gist_id}","starred_url":"https://api.github.com/users/fmassa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmassa/subscriptions","organizations_url":"https://api.github.com/users/fmassa/orgs","repos_url":"https://api.github.com/users/fmassa/repos","events_url":"https://api.github.com/users/fmassa/events{/privacy}","received_events_url":"https://api.github.com/users/fmassa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-09T15:49:16Z","updated_at":"2015-04-09T16:35:31Z","closed_at":null,"body":"The field freeGlobalMem in function getDeviceProperties calls cudaMemGetInfo, which outputs the available memory in the current device. Thus, the gpuid is not taken into account in this field, unless one manually calls cutorch.setDevice(gpuid) before (or putting it inside getDeviceProperties and then restoring to the previous gpu after this call). Is there a better way to solve this problem, without needing to set the device in each call to getDeviceProperties ?"},"comment":{"url":"https://api.github.com/repos/torch/cutorch/issues/comments/91285012","html_url":"https://github.com/torch/cutorch/issues/130#issuecomment-91285012","issue_url":"https://api.github.com/repos/torch/cutorch/issues/130","id":91285012,"user":{"login":"soumith","id":1310570,"avatar_url":"https://avatars.githubusercontent.com/u/1310570?v=3","gravatar_id":"","url":"https://api.github.com/users/soumith","html_url":"https://github.com/soumith","followers_url":"https://api.github.com/users/soumith/followers","following_url":"https://api.github.com/users/soumith/following{/other_user}","gists_url":"https://api.github.com/users/soumith/gists{/gist_id}","starred_url":"https://api.github.com/users/soumith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soumith/subscriptions","organizations_url":"https://api.github.com/users/soumith/orgs","repos_url":"https://api.github.com/users/soumith/repos","events_url":"https://api.github.com/users/soumith/events{/privacy}","received_events_url":"https://api.github.com/users/soumith/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T16:35:31Z","updated_at":"2015-04-09T16:35:31Z","body":"there is cutorch.getMemoryUsage() but that also assumes the current device.\r\nhttps://github.com/torch/cutorch/blob/master/init.c#L515\r\n\r\nI'll patch that to take a device argument"}}