cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

notyou
Adept III

Re: Sample program not requiring any SDK?

OK, if I remember, you've got the linker but you haven't included the CL.hpp file. You should add -I <path to CL.hpp> (made up example: -I /usr/lib/CL/CL.hpp ) to the command line. If this doesn't finish it, I'll post back when I'm at my Linux machine.

0 Likes
notzed
Challenger

Re: Sample program not requiring any SDK?

It doesn't need 'fall back', it just doesn't find any GPU devices in that case.  Obviously AMD isn't going to include an Nvidia driver in their software even if they had enough information to do it; OpenCL has explicit support for multiple vendors via the platform abstraction.

So the AMD platform would just list the CPU driver by itself if there was no AMD GPU installed.

I use this scenario for testing inside virtualbox so I don't have to reboot into microsoft's  os just to check the code will run on the client's machine.

0 Likes
thedl
Journeyman III

Re: Sample program not requiring any SDK?

Yeah, no luck. I greatly appreciate your help though.

0 Likes
notyou
Adept III

Re: Sample program not requiring any SDK?

This is what I used to compile the hello world program here:

http://www.thebigblob.com/getting-started-with-opencl-and-gpu-computing/

 

Copy the CL and lib folders into your project folder. // just so I can always use the same path

 

Then use "g++ -c -I /home/ideas/Downloads/ main.cpp -o main.o" and

              "g++ -L /home/ideas/Downloads/lib/x86/ -l OpenCL main.o -o host" to compile the program.

// obviously, replace the path with your own location.

Then run the program using ./host.

0 Likes
thedl
Journeyman III

Re: Sample program not requiring any SDK?

Still not working:

g++ -c -I /home/dl/test  opencl_hello_world.c -o main.o

opencl_hello_world.c:19:1: warning: deprecated conversion from string constant to ‘char*’

g++ -L /home/dl/test/lib/x86_64 -I OpenCL main.o -o host

main.o: In function `main':

opencl_hello_world.c:(.text+0x6e): undefined reference to `clGetDeviceIDs'

opencl_hello_world.c:(.text+0x95): undefined reference to `clCreateContext'

opencl_hello_world.c:(.text+0xb3): undefined reference to `clCreateCommandQueue'

opencl_hello_world.c:(.text+0xda): undefined reference to `clCreateBuffer'

opencl_hello_world.c:(.text+0xff): undefined reference to `clCreateProgramWithSource'

opencl_hello_world.c:(.text+0x12a): undefined reference to `clBuildProgram'

opencl_hello_world.c:(.text+0x140): undefined reference to `clCreateKernel'

opencl_hello_world.c:(.text+0x161): undefined reference to `clSetKernelArg'

opencl_hello_world.c:(.text+0x1b9): undefined reference to `clEnqueueNDRangeKernel'

opencl_hello_world.c:(.text+0x1f9): undefined reference to `clEnqueueReadBuffer'

opencl_hello_world.c:(.text+0x205): undefined reference to `clReleaseMemObject'

opencl_hello_world.c:(.text+0x211): undefined reference to `clReleaseKernel'

opencl_hello_world.c:(.text+0x21d): undefined reference to `clReleaseProgram'

opencl_hello_world.c:(.text+0x229): undefined reference to `clReleaseCommandQueue'

opencl_hello_world.c:(.text+0x235): undefined reference to `clReleaseContext'

collect2: ld returned 1 exit status

I have included both the CL and lib folders into the test folder.

0 Likes
thedl
Journeyman III

Re: Sample program not requiring any SDK?

Actually it compiles since I thought -I was a capitalized i and not an l.

But when I try to run it, it just seg faults.

0 Likes
notyou
Adept III

Re: Sample program not requiring any SDK?

Then all I can guess is that something in youur environment isn't set up properly. Unless you want to put printfs through the program to see where it's segfaulting.

0 Likes