{"action":"created","issue":{"url":"https://api.github.com/repos/lxc/lxd/issues/4534","repository_url":"https://api.github.com/repos/lxc/lxd","labels_url":"https://api.github.com/repos/lxc/lxd/issues/4534/labels{/name}","comments_url":"https://api.github.com/repos/lxc/lxd/issues/4534/comments","events_url":"https://api.github.com/repos/lxc/lxd/issues/4534/events","html_url":"https://github.com/lxc/lxd/issues/4534","id":320251629,"number":4534,"title":"Nvidia-smi (No devices where found) if not using root in the container","user":{"login":"cyberwillis","id":2855438,"avatar_url":"https://avatars1.githubusercontent.com/u/2855438?v=4","gravatar_id":"","url":"https://api.github.com/users/cyberwillis","html_url":"https://github.com/cyberwillis","followers_url":"https://api.github.com/users/cyberwillis/followers","following_url":"https://api.github.com/users/cyberwillis/following{/other_user}","gists_url":"https://api.github.com/users/cyberwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/cyberwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyberwillis/subscriptions","organizations_url":"https://api.github.com/users/cyberwillis/orgs","repos_url":"https://api.github.com/users/cyberwillis/repos","events_url":"https://api.github.com/users/cyberwillis/events{/privacy}","received_events_url":"https://api.github.com/users/cyberwillis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-05-04T12:10:49Z","updated_at":"2018-05-04T21:13:57Z","closed_at":null,"author_association":"NONE","body":"# Required information\r\n\r\n * Distribution: Ubuntu\r\n * Distribution version: 16.04\r\n * The output of \"lxc info\" or if that fails: \r\n   * Kernel version: 4.15.0-15-lowlatency\r\n   * LXC version: 2.21\r\n   * LXD version: 3.0.0\r\n   * Storage backend in use: N/A\r\n\r\n# Issue description\r\n\r\nSorry if its a dumb question but, after creates a container with GPU / Cuda capabilites I cannot run nvidia-smi as user **ubuntu**, but is possible to run as user **root**\r\n\r\n# Steps to reproduce\r\n\r\n1. Setting up the container\r\n```\r\nlxc launch ubuntu:16.04 my_container\r\nlxc config device add my_container gtx gpu\r\nlxc config set my_container nvidia.runtime true\r\nlxc restart my_container\r\n```\r\n\r\n2.Accessing the nvidia GPU as Root : **Here everything works out**\r\n```\r\nlxc exec my_container \"nvidia-smi\"\r\n\r\nor\r\n\r\nlxc exec my_container -- su root -c \"nvidia-smi\"\r\n```\r\n\r\n3.Accessing the nvidia GPU as Ubuntu : **No devices were found**\r\n```\r\nlxc exec my_container -- su ubuntu -c \"nvidia-smi\"\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/lxc/lxd/issues/comments/386736894","html_url":"https://github.com/lxc/lxd/issues/4534#issuecomment-386736894","issue_url":"https://api.github.com/repos/lxc/lxd/issues/4534","id":386736894,"user":{"login":"stgraber","id":2230599,"avatar_url":"https://avatars0.githubusercontent.com/u/2230599?v=4","gravatar_id":"","url":"https://api.github.com/users/stgraber","html_url":"https://github.com/stgraber","followers_url":"https://api.github.com/users/stgraber/followers","following_url":"https://api.github.com/users/stgraber/following{/other_user}","gists_url":"https://api.github.com/users/stgraber/gists{/gist_id}","starred_url":"https://api.github.com/users/stgraber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stgraber/subscriptions","organizations_url":"https://api.github.com/users/stgraber/orgs","repos_url":"https://api.github.com/users/stgraber/repos","events_url":"https://api.github.com/users/stgraber/events{/privacy}","received_events_url":"https://api.github.com/users/stgraber/received_events","type":"User","site_admin":false},"created_at":"2018-05-04T21:13:57Z","updated_at":"2018-05-04T21:13:57Z","author_association":"OWNER","body":"Yeah, had a chat with @brauner and he said we're using our default device passthrough code, which unless you're specifying your own mode.\r\n\r\n```\r\n        // Get the device mode\r\n        mode := os.FileMode(0660)\r\n        if m[\"mode\"] != \"\" {\r\n                tmp, err := deviceModeOct(m[\"mode\"])\r\n                if err != nil {\r\n                        return nil, fmt.Errorf(\"Bad mode %s in device %s\", m[\"mode\"], m[\"path\"])\r\n                }\r\n                mode = os.FileMode(tmp)\r\n        }\r\n```\r\n\r\nWhat we should do when passing devices automatically (so for GPU, USB and Infiniband) is replicate the permissions found on the host.\r\n\r\n@brauner assigning to you"}}
{"actor":{"display_login":"stgraber"}}