{"action":"created","issue":{"url":"https://api.github.com/repos/cbclab/MDT/issues/5","repository_url":"https://api.github.com/repos/cbclab/MDT","labels_url":"https://api.github.com/repos/cbclab/MDT/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/cbclab/MDT/issues/5/comments","events_url":"https://api.github.com/repos/cbclab/MDT/issues/5/events","html_url":"https://github.com/cbclab/MDT/issues/5","id":297155295,"number":5,"title":"mdt-list-devices fails with clCreateContext failed: INVALID_DEVICE","user":{"login":"kcgthb","id":186807,"avatar_url":"https://avatars1.githubusercontent.com/u/186807?v=4","gravatar_id":"","url":"https://api.github.com/users/kcgthb","html_url":"https://github.com/kcgthb","followers_url":"https://api.github.com/users/kcgthb/followers","following_url":"https://api.github.com/users/kcgthb/following{/other_user}","gists_url":"https://api.github.com/users/kcgthb/gists{/gist_id}","starred_url":"https://api.github.com/users/kcgthb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kcgthb/subscriptions","organizations_url":"https://api.github.com/users/kcgthb/orgs","repos_url":"https://api.github.com/users/kcgthb/repos","events_url":"https://api.github.com/users/kcgthb/events{/privacy}","received_events_url":"https://api.github.com/users/kcgthb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"robbert-harms","id":5983803,"avatar_url":"https://avatars3.githubusercontent.com/u/5983803?v=4","gravatar_id":"","url":"https://api.github.com/users/robbert-harms","html_url":"https://github.com/robbert-harms","followers_url":"https://api.github.com/users/robbert-harms/followers","following_url":"https://api.github.com/users/robbert-harms/following{/other_user}","gists_url":"https://api.github.com/users/robbert-harms/gists{/gist_id}","starred_url":"https://api.github.com/users/robbert-harms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbert-harms/subscriptions","organizations_url":"https://api.github.com/users/robbert-harms/orgs","repos_url":"https://api.github.com/users/robbert-harms/repos","events_url":"https://api.github.com/users/robbert-harms/events{/privacy}","received_events_url":"https://api.github.com/users/robbert-harms/received_events","type":"User","site_admin":false},"assignees":[{"login":"robbert-harms","id":5983803,"avatar_url":"https://avatars3.githubusercontent.com/u/5983803?v=4","gravatar_id":"","url":"https://api.github.com/users/robbert-harms","html_url":"https://github.com/robbert-harms","followers_url":"https://api.github.com/users/robbert-harms/followers","following_url":"https://api.github.com/users/robbert-harms/following{/other_user}","gists_url":"https://api.github.com/users/robbert-harms/gists{/gist_id}","starred_url":"https://api.github.com/users/robbert-harms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbert-harms/subscriptions","organizations_url":"https://api.github.com/users/robbert-harms/orgs","repos_url":"https://api.github.com/users/robbert-harms/repos","events_url":"https://api.github.com/users/robbert-harms/events{/privacy}","received_events_url":"https://api.github.com/users/robbert-harms/received_events","type":"User","site_admin":false}],"milestone":null,"comments":14,"created_at":"2018-02-14T16:16:08Z","updated_at":"2018-02-16T17:32:20Z","closed_at":null,"author_association":"NONE","body":"Hi!\r\n\r\nUsing MDT 0.10.7, I can't seem to get the OpenCL context creation work.\r\n\r\n`mdt-list-devices` fails with the following stack:\r\n```\r\n$ mdt-list-devices\r\nTraceback (most recent call last):\r\n  File \"/share/software/user/open/py-mdt/0.10.7_py36/bin/mdt-list-devices\", line 11, in <module>\r\n    sys.exit(ListDevices.console_script())\r\n  File \"/share/software/user/open/py-mdt/0.10.7_py36/lib/python3.6/site-packages/mdt/shell_utils.py\", line 44, in console_script\r\n    cls().start(sys.argv[1:])\r\n  File \"/share/software/user/open/py-mdt/0.10.7_py36/lib/python3.6/site-packages/mdt/shell_utils.py\", line 63, in start\r\n    self.run(args, {})\r\n  File \"/share/software/user/open/py-mdt/0.10.7_py36/lib/python3.6/site-packages/mdt/cli_scripts/mdt_list_devices.py\", line 28, in run\r\n    for ind, env in enumerate(cl_environments.CLEnvironmentFactory.smart_device_selection()):\r\n  File \"/share/software/user/open/py-mdt/0.10.7_py36/lib/python3.6/site-packages/mot/cl_environments.py\", line 255, in smart_device_selection\r\n    cl_environments = CLEnvironmentFactory.all_devices()\r\n  File \"/share/software/user/open/py-mdt/0.10.7_py36/lib/python3.6/site-packages/mot/cl_environments.py\", line 235, in all_devices\r\n    env = CLEnvironment(platform, device)\r\n  File \"/share/software/user/open/py-mdt/0.10.7_py36/lib/python3.6/site-packages/mot/cl_environments.py\", line 23, in __init__\r\n    self._cl_context = CLRunContext(self)\r\n  File \"/share/software/user/open/py-mdt/0.10.7_py36/lib/python3.6/site-packages/mot/cl_environments.py\", line 151, in __init__\r\n    self.context = cl.Context([cl_environment.device])\r\n  File \"/share/software/user/open/py-mdt/0.10.7_py36/lib/python3.6/site-packages/pyopencl/cffi_cl.py\", line 811, in __init__\r\n    num_devices, _devices))\r\n  File \"/share/software/user/open/py-mdt/0.10.7_py36/lib/python3.6/site-packages/pyopencl/cffi_cl.py\", line 664, in _handle_error\r\n    raise e\r\npyopencl.cffi_cl.LogicError: clCreateContext failed: INVALID_DEVICE\r\n```\r\n\r\nThis is with CUDA 9.1 and a Tesla P100 GPU:\r\n```\r\n$ nvidia-smi -L\r\nGPU 0: Tesla P100-SXM2-16GB (UUID: GPU-[...])\r\n```\r\n\r\nOpenCL programs work properly in the same context, including the [PyOpenCL benchmark](https://github.com/inducer/pyopencl/blob/master/examples/benchmark.py):\r\n```\r\n$ python3 benchmark.py\r\nExecution time of test without OpenCL:  0.10260295867919922 s\r\n===============================================================\r\nPlatform name: NVIDIA CUDA\r\nPlatform profile: FULL_PROFILE\r\nPlatform vendor: NVIDIA Corporation\r\nPlatform version: OpenCL 1.2 CUDA 9.1.84\r\n---------------------------------------------------------------\r\nDevice name: Tesla P100-SXM2-16GB\r\nDevice type: GPU\r\nDevice memory:  16280 MB\r\nDevice max clock speed: 1480 MHz\r\nDevice compute units: 56\r\nDevice max work group size: 1024\r\nDevice max work item sizes: [1024, 1024, 64]\r\nData points: 8388608\r\nWorkers: 256\r\nPreferred work group size multiple: 32\r\nExecution time of test: 0.000208416 s\r\nResults OK\r\n```\r\n\r\nDo you have any idea what the problem may be?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/cbclab/MDT/issues/comments/366303611","html_url":"https://github.com/cbclab/MDT/issues/5#issuecomment-366303611","issue_url":"https://api.github.com/repos/cbclab/MDT/issues/5","id":366303611,"user":{"login":"kcgthb","id":186807,"avatar_url":"https://avatars1.githubusercontent.com/u/186807?v=4","gravatar_id":"","url":"https://api.github.com/users/kcgthb","html_url":"https://github.com/kcgthb","followers_url":"https://api.github.com/users/kcgthb/followers","following_url":"https://api.github.com/users/kcgthb/following{/other_user}","gists_url":"https://api.github.com/users/kcgthb/gists{/gist_id}","starred_url":"https://api.github.com/users/kcgthb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kcgthb/subscriptions","organizations_url":"https://api.github.com/users/kcgthb/orgs","repos_url":"https://api.github.com/users/kcgthb/repos","events_url":"https://api.github.com/users/kcgthb/events{/privacy}","received_events_url":"https://api.github.com/users/kcgthb/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T17:32:19Z","updated_at":"2018-02-16T17:32:19Z","author_association":"NONE","body":"Hi Robbert,\r\n\r\nI just updated, but unfortunately, that doesn't seem to fix the issue:\r\n```\r\n[kilian@sh-114-03 ~]$ mdt-list-devices\r\nTraceback (most recent call last):\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/bin/mdt-list-devices\", line 11, in <module>\r\n    sys.exit(ListDevices.console_script())\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/mdt/shell_utils.py\", line 44, in console_script\r\n    cls().start(sys.argv[1:])\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/mdt/shell_utils.py\", line 63, in start\r\n    self.run(args, {})\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/mdt/cli_scripts/mdt_list_devices.py\", line 28, in run\r\n    for ind, env in enumerate(cl_environments.CLEnvironmentFactory.smart_device_selection()):\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/mot/cl_environments.py\", line 254, in smart_device_selection\r\n    cl_environments = CLEnvironmentFactory.all_devices()\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/mot/cl_environments.py\", line 234, in all_devices\r\n    env = CLEnvironment(platform, device)\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/mot/cl_environments.py\", line 23, in __init__\r\n    self._context = cl.Context([device])\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/pyopencl/cffi_cl.py\", line 811, in __init__\r\n    num_devices, _devices))\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/pyopencl/cffi_cl.py\", line 664, in _handle_error\r\n    raise e\r\npyopencl.cffi_cl.LogicError: clCreateContext failed: INVALID_DEVICE\r\n```\r\n\r\nSome more info:\r\n```\r\n$ python3\r\nPython 3.6.1 (default, Apr 27 2017, 10:57:56)\r\n[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import pyopencl as cl\r\n>>> from mot.cl_environments import CLEnvironment\r\n>>> platform = cl.get_platforms()[0]\r\n>>> device = platform.get_devices()[0]\r\n>>> env = CLEnvironment(platform, device)\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/mot/cl_environments.py\", line 23, in __init__\r\n    self._context = cl.Context([device])\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/pyopencl/cffi_cl.py\", line 811, in __init__\r\n    num_devices, _devices))\r\n  File \"/share/software/user/open/py-mdt/0.10.8_py36/lib/python3.6/site-packages/pyopencl/cffi_cl.py\", line 664, in _handle_error\r\n    raise e\r\npyopencl.cffi_cl.LogicError: clCreateContext failed: INVALID_DEVICE\r\n>>> \r\n>>> import mot\r\n>>> print(mot.__version__)\r\n0.3.11\r\n```"}}
{"actor":{"display_login":"kcgthb"}}