Thanks for good job. Worked fine for me.
(Kubuntu 9.10 x64)
hope for futher releases from you mate
thanks i am glad that someone actualy use it.
Thanks a lot! I was totally miffed how to install the SDK under ubuntu 9.10. This got everything working very well. I haven't been able to get things running on the gpu yet, but I should be able to figure it out.
Thanks again.
Thanks for the packages!
Haven't you considered creating a repository to these packages, like one in PPA Launchpad?
https://help.launchpad.net/Packaging/PPA
I know it may be too much trouble, but it could eventually be included in official multiverse repository...
problem of PPA is that you must upload source package and on server side it compile into binary. or i overseen something and it is possible upload binary packages into PPA?
I believe you are rigth nou, but a workarount this could be creating a official AMD Repository or as has been shown in the past with Video Drivers include them int he official Ubuntu Repositry by talking to the Ubuntu Devs.
and in my honest opinion i believe creating a official repository could be much better, because there is controll and you can get stats and see how much people is actually using it.
Hi to everyone.
First I have to thank nou for his deb packages but I'm still have a problem...
I don't really understand which variable I have to update after the installation when you say:
after instalation you must logout and logon to set enviroment variables.
Infact when I try to compile a simple opencl example, I have linking problems:
Do you have any idea? thanks in advance, Paolo.
gcc main.c /tmp/cc7UujWy.o: In function `runCL': main.c:(.text+0x107): undefined reference to `clGetDeviceIDs' main.c:(.text+0x1d3): undefined reference to `clGetDeviceInfo' main.c:(.text+0x20b): undefined reference to `clGetDeviceInfo' main.c:(.text+0x2a0): undefined reference to `clCreateContext' main.c:(.text+0x304): undefined reference to `clCreateCommandQueue' main.c:(.text+0x35a): undefined reference to `clCreateProgramWithSource' main.c:(.text+0x3c4): undefined reference to `clBuildProgram' main.c:(.text+0x418): undefined reference to `clCreateKernel' main.c:(.text+0x462): undefined reference to `clCreateBuffer' main.c:(.text+0x4bc): undefined reference to `clEnqueueWriteBuffer' main.c:(.text+0x4fa): undefined reference to `clCreateBuffer' main.c:(.text+0x554): undefined reference to `clEnqueueWriteBuffer' main.c:(.text+0x5c8): undefined reference to `clCreateBuffer' main.c:(.text+0x5dc): undefined reference to `clFinish' main.c:(.text+0x604): undefined reference to `clSetKernelArg' main.c:(.text+0x632): undefined reference to `clSetKernelArg' main.c:(.text+0x668): undefined reference to `clSetKernelArg' main.c:(.text+0x6ff): undefined reference to `clEnqueueNDRangeKernel' main.c:(.text+0x741): undefined reference to `clFinish' main.c:(.text+0x795): undefined reference to `clEnqueueReadBuffer' main.c:(.text+0x7d7): undefined reference to `clFinish' main.c:(.text+0x7e5): undefined reference to `clReleaseMemObject' main.c:(.text+0x7f3): undefined reference to `clReleaseMemObject' main.c:(.text+0x801): undefined reference to `clReleaseMemObject' main.c:(.text+0x80f): undefined reference to `clReleaseCommandQueue' main.c:(.text+0x81d): undefined reference to `clReleaseContext'
zou must link OpenCL lib. so use this
gcc -lOpenCL main.c
Thank you very very much!!!
It worked!! I thought I had to use -lCL...
Thanks againg.. really! 🙂
nou, it works like magic!
Can you tell me what these packages do? I had been trying to setup the Streeam SDK environment, but I just couldn't get the sample programs run successfully until I tried your package. I would like very much to know what magic these packages do.
it is black magic
it is just put files into right places. that is all. you can extract package and look into yourself.
Hi,
I tried to run it on my notebook. With g++ compiler it runs fine.
But if I try to compile the code with the intel c compiler, I get an error:
icc -lOpenCL test.cpp
/usr/include/CL/cl_platform.h(219): error: invalid attribute for "__cl_float2={float}"
typedef cl_float __cl_float2 __attribute__((vector_size(8)));
^
compilation aborted for test.cpp (code 2)
Does anybody know why this error occurs?
Sheeep,
Which version of intel compiler are you using?
I'm using Intel C Compiler Version 11.1
sheeep,
Could you post your source code?
Hi,
I use a simple vector addition to test it.
I always get the error, if I use the intel c compiler 11.1:
user$ icc -lOpenCL Main_Test_1.cpp
/usr/include/CL/cl_platform.h(294): error: invalid attribute for "__cl_float2={float}"
typedef cl_float __cl_float2 __attribute__((vector_size(8)));
^
compilation aborted for Main_Test_1.cpp (code 2)
Using g++ or gcc it runs fine.
But when I use icc and just include the cl.h or cl.hpp header I get the error.
I can write a simple helloworld in c, and include the cl.h header and I will get this error.
The error is in cl_platform.h, but I don't know, why only the icc fails with this error. g++ runs fine.
//Hostcode: #include <iostream> #include <fstream> #include <cstdlib> #include <CL/cl.h> #include <string> #include <ctime> #include <vector> void errcheck(int error,std::string error_code){ if(error!=CL_SUCCESS){ std::cout<<"Error: "<<error_code<<"("<<error<<")"<<std::endl; exit(-1); } } int main(int argc,char** argv) { cl_int error=-1; //Platform info cl_uint numPlatforms; cl_platform_id platform = NULL; clGetPlatformIDs(0, NULL, &numPlatforms); if (0 < numPlatforms){ cl_platform_id* platforms = new cl_platform_id[numPlatforms]; clGetPlatformIDs(numPlatforms, platforms, NULL); for (unsigned i = 0; i < numPlatforms; ++i){ char pbuf[100]; clGetPlatformInfo(platforms,CL_PLATFORM_VENDOR,sizeof(pbuf),pbuf,NULL); platform = platforms; // if (!strcmp(pbuf, "Advanced Micro Devices, Inc."))break; } delete[] platforms; } cl_context_properties cps[3] ={CL_CONTEXT_PLATFORM,(cl_context_properties)platform,0}; cl_context_properties* cprops =(platform==NULL) ? NULL : cps; //create Context cl_context hContext; hContext=clCreateContextFromType(cprops,CL_DEVICE_TYPE_GPU,0,0,&error);errcheck(error,"clCreateContextFromType"); //query all OpenCL device & context size_t nContextDescriptorSize; clGetContextInfo(hContext,CL_CONTEXT_DEVICES,0,0,&nContextDescriptorSize); cl_device_id *aDevices =(cl_device_id*)malloc(nContextDescriptorSize); clGetContextInfo(hContext,CL_CONTEXT_DEVICES,nContextDescriptorSize,aDevices,0); //create command queue cl_command_queue hCmdQueue; hCmdQueue=clCreateCommandQueue(hContext,aDevices[0],0,0); //read program std::ifstream file("OpenCL_Test_1.cl"); std::string prog(std::istreambuf_iterator<char>(file),(std::istreambuf_iterator<char>())); const char *sProgramSource=prog.c_str(); //create & compile program cl_program hProgram; hProgram =clCreateProgramWithSource(hContext,1,(const char **)&sProgramSource,0,&error); errcheck(error,"clCreateProgramWithSource"); error=clBuildProgram(hProgram,0,0,0,0,0); errcheck(error,"clBuildProgram"); //create Kernel cl_kernel hKernel; hKernel=clCreateKernel(hProgram,"Vec_ADD",0); //allocate Hostmemory cl_int wsize=10; //error=clGetDeviceInfo(aDevices[0],CL_DEVICE_MAX_WORK_GROUP_SIZE,sizeof(int),(void*)&wsize,NULL); errcheck(error,"clGetDeviceInfo"); size_t worksize[]={wsize,1,1}; cl_int *a=new cl_int[wsize]; cl_int *b=new cl_int[wsize]; cl_int *c=new cl_int[wsize]; //set Hostmemory for(int i=0;i<wsize;i++){ a=i; b=wsize-i; } //allocate Devicememory cl_mem CL1,CL2,CL3; CL1=clCreateBuffer(hContext,CL_MEM_READ_ONLY|CL_MEM_COPY_HOST_PTR,sizeof(cl_int)*wsize,a,0); CL2=clCreateBuffer(hContext,CL_MEM_READ_ONLY |CL_MEM_COPY_HOST_PTR,sizeof(cl_int)*wsize,b,0); CL3=clCreateBuffer(hContext,CL_MEM_READ_WRITE|CL_MEM_COPY_HOST_PTR,sizeof(cl_int)*wsize,c,0); //setKernelarg error=clSetKernelArg(hKernel,0,sizeof(cl_mem),(void *)&CL1);errcheck(error,"clSetKernelArg_1"); error=clSetKernelArg(hKernel,1,sizeof(cl_mem),(void *)&CL2);errcheck(error,"clSetKernelArg_2"); error=clSetKernelArg(hKernel,2,sizeof(cl_mem),(void *)&CL3);errcheck(error,"clSetKernelArg_3"); //run Kernel clock_t time=clock(); clFinish(hCmdQueue); error=clEnqueueNDRangeKernel(hCmdQueue, hKernel,1,0,worksize,0,0,0,0); errcheck(error,"clEnqueueNDRangeKernel"); //copy mem back error=clEnqueueReadBuffer(hCmdQueue,CL3,CL_TRUE,0,sizeof(cl_int)*wsize,c,0,0,0); errcheck(error,"clEnqueueReadBuffer"); clFinish(hCmdQueue); time=clock()-time; std::cout<<std::endl<<"Ausgabe:"<<std::endl; for(int i=0;i<wsize;i++){ std::cout<<c<<" "; } std::cout<<std::endl<<std::endl; std::cout<<std::endl<<"Zeit: "<<time<<"ms"<<std::endl<<std::endl; delete [] a; delete [] b; delete [] c; clReleaseMemObject(CL1); clReleaseMemObject(CL2); clReleaseMemObject(CL3); return 0; } //Kernel: __kernel void Vec_ADD(__global const int *a,__global const int *b,__global int *c){ int gid = get_global_id(0); c[gid]=a[gid]+b[gid]; }
The issue has been fixed and you can expect it to work in an upcoming release. Thanks for reporting.
omkaranathan
Thank you for your answer.
Is there any short term fix to getting the problem compiling using icc and cl_platform.h reported by Sheeep.
I'm using the Stream SDK v2.1 and trying to get it to work with icc 11.0 which looks like it should work according to the release notes. I get the same compile time error from cl_platform.h reported by Sheeep.
Thanks.
Building build/debug/x86_64//SDKCommon.o icc -Wfloat-equal -Wpointer-arith -DATI_OS_LINUX -g3 -ffor-scope -I ../../../include -I ../../../samples/opencl/SDKUtil -I ../../../include -o build/debug/x86_64//SDKCommon.o -c SDKCommon.cpp icc: command line warning #10156: ignoring option '-W'; no argument required ../../../include/CL/cl_platform.h(245): error: invalid attribute for "__cl_float2={float}" typedef cl_float __cl_float2 __attribute__((vector_size(8))); ^
why did you ask here?
nreddell,
The issue has been fixed. You can expect to see the change in an upcoming release.
Hi
I have just installed Ubuntu 10.4
and I installed nou's deb-packages.
Compiling OpenCL with gcc ist no problem.
But wenn I try to run executable, I get an error:
error while loading shared libraries: libOpenCL.so.1: cannot open shared object file: No such file or directory
strange. what is your echo $ATISTREMSDKROOT ?
and ldd your_OpenCL_app
Ok, the problem is $ATISTREMSDKROOT is not set.
echo $ATISTREMSDKROOT is empty
but in /etc/profile.d/ati-opencl.sh is:
#!/bin/sh
export ATISTREAMSDKROOT=/usr/local
is this right?
Do I have to set ATISTREAMSDKROOT somewhere else?
I use ubuntu 10.6 x86_64, kernel 2.6.32-23
oh that was typo. it should be $ATISTREAMSDKROOT.
try run "ldd some_OpenCL_app"
hi,
ldd ./openclapp prints:
linux-vdso.so.1 => (0x00007fffbe6ee000)
libOpenCL.so => /usr/lib/libOpenCL.so (0x00007f7af6c87000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f7af6973000)
libm.so.6 => /lib/libm.so.6 (0x00007f7af66ef000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f7af64d8000)
libc.so.6 => /lib/libc.so.6 (0x00007f7af6156000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f7af5f38000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f7af5d34000)
librt.so.1 => /lib/librt.so.1 (0x00007f7af5b2c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7af6ea8000)
EDIT:
I get the message
sh: /bin/x86_64/clc: not found
if I run getBuildInfo.
so I looked in /bin, but there is no folder x86_64.
is this the problem?
and what about examples from SDK. did you try run it?
No I cant run examples from SDK...
Last time I installed .deb packages and all worked....
It should work so in Ubuntu 10.4, shouldn't it?
yes it should. i have ubuntu 10.04 too and installed packages. try it redownload it an reinstall. and check if /usr/local/bin/x86_64/clc is in place.
/usr/local/bin/x86_64/clc does not exist...
ok i try reinstall...
Hi,
i reinstalled ati stream sdk. Now I have clc in:
/usr/local/bin/x86/clc
/usr/local/bin/x86_64/clc
check if is set $ATISTREAMSDKROOT
I solved the problem:
I add export ATISTREAMSDKROOT=/usr/local to .bashrc....
Thanks for your help nou
since more developers will have a quick install option, the packages will be far more easy to be distributed and updated.
May here will help you: https://help.launchpad.net/Packaging/PPA
to use PPA you must provide a source code. then it will be compiled on Ubuntu servers and from this created packages.
updated to 2.4
Thanks for the update, but with 11.04 Natty-x86_64 the Ubuntu software centre gives some very serious sounding warnings that it could bork my system when I go to install.
well that is because it is not from official repository or signed repostory on launchpad. but chance that you bork system is same as when you install original AMD APP SDK.