{"action":"opened","issue":{"url":"https://api.github.com/repos/RadeonOpenCompute/ROCm/issues/57","repository_url":"https://api.github.com/repos/RadeonOpenCompute/ROCm","labels_url":"https://api.github.com/repos/RadeonOpenCompute/ROCm/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/RadeonOpenCompute/ROCm/issues/57/comments","events_url":"https://api.github.com/repos/RadeonOpenCompute/ROCm/issues/57/events","html_url":"https://github.com/RadeonOpenCompute/ROCm/issues/57","id":196298346,"number":57,"title":"Some pointers on how to use OpenCL + ROCm","user":{"login":"rjfnobre","id":19553137,"avatar_url":"https://avatars.githubusercontent.com/u/19553137?v=3","gravatar_id":"","url":"https://api.github.com/users/rjfnobre","html_url":"https://github.com/rjfnobre","followers_url":"https://api.github.com/users/rjfnobre/followers","following_url":"https://api.github.com/users/rjfnobre/following{/other_user}","gists_url":"https://api.github.com/users/rjfnobre/gists{/gist_id}","starred_url":"https://api.github.com/users/rjfnobre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjfnobre/subscriptions","organizations_url":"https://api.github.com/users/rjfnobre/orgs","repos_url":"https://api.github.com/users/rjfnobre/repos","events_url":"https://api.github.com/users/rjfnobre/events{/privacy}","received_events_url":"https://api.github.com/users/rjfnobre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-18T20:48:31Z","updated_at":"2016-12-18T20:48:31Z","closed_at":null,"body":"I just installed the latest version of ROCm and realised that there is no GPU device recognized by the \"AMD Accelerated Parallel Processing\" OpenCL platform.\r\n\r\nI'm aware that there are some changes in relation to the way to use OpenCL with the ROCm driver.\r\n\r\nFor instance, the following Makefile works perfectly and a binary 'app' is produced.\r\n\r\n**Makefile:**\r\nEXECUTABLE := app\r\nCFILES := app.c\r\nOpenCL_SDK=/opt/AMDAPPSDK-3.0\r\nINCLUDE=-I${OpenCL_SDK}/include\r\nLIBPATH=-L${OpenCL_SDK}/lib/x86_64\r\nLIB=-lOpenCL -lm\r\nall:\r\n        gcc -O3 ${INCLUDE} ${LIBPATH} ${CFILES} ${LIB} -o ${EXECUTABLE}\r\nclean:\r\n        rm -f *~ *.exe\r\n\r\n**Portion of code from 'app.c' that initializes the OpenCL platform:**\r\n        errcode = clGetPlatformIDs(1, &platform_id, &num_platforms);\r\n        if(errcode == CL_SUCCESS) printf(\"number of platforms is %d\\n\",num_platforms);\r\n        else printf(\"Error getting platform IDs\\n\");\r\n        errcode = clGetPlatformInfo(platform_id,CL_PLATFORM_NAME, sizeof(str_temp), str_temp,NULL);\r\n        if(errcode == CL_SUCCESS) printf(\"platform name is %s\\n\",str_temp);\r\n        else printf(\"Error getting platform name\\n\");\r\n        errcode = clGetPlatformInfo(platform_id, CL_PLATFORM_VERSION, sizeof(str_temp), str_temp,NULL);\r\n        if(errcode == CL_SUCCESS) printf(\"platform version is %s\\n\",str_temp);\r\n        else printf(\"Error getting platform version\\n\");\r\n        errcode = clGetDeviceIDs( platform_id,  CL_DEVICE_TYPE_GPU, 1, &device_id, &num_devices);\r\n        if(errcode == CL_SUCCESS) printf(\"number of devices is %d\\n\", num_devices);\r\n        else printf(\"Error getting device IDs\\n\");\r\n\r\nThe call to clGetDeviceIDs() results in an error, which does not surprise me given that the \"AMD Accelerated Parallel Processing\" OpenCL platform only recognizes the CPU (the GPU is not listed when executing 'clinfo').\r\n\r\nThe GPU is a R9 Nano (same Fiji core as the Fury X), wich to my undertanding is supported by ROCm.\r\n\r\nMy question is, how can I compile my OpenCL apps in a machine with ROCm installed?\r\n\r\nThanks in advance!\r\n"}}
{"actor":{"display_login":"rjfnobre"}}