cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ryta1203
Journeyman III

Nvidia OpenCL samples on AMD GPU

Does anyone know or has gotten the Nvidia OpenCL samples to run on AMD GPUs?

0 Likes
15 Replies

Ryta,
Which sample are you having trouble running? I can test it on my machine to verify if it is having any issues.
0 Likes

oclFDTD3d sample from Nvidia. Trying to run it on 5870 machine

I get a bug in the clCreateContext.. Type function call.

0 Likes

I'm not having any problems running that particular sample, but I also don't have an nvidia card or nvidia's sdk installed, I just ran the binary.
0 Likes

Ah, wrong question:

Should I be able to build their samples in AMD SDK?

0 Likes

i extracted cuda SDK and then run makefile on OpenCL directory. everything is compiled fine and most of samples works too.

0 Likes

I'm on Windows and I don't see a Makefile.

Also, the .exe in the bin folder don't run either.

0 Likes

Are you not able to recompile and run too? 

What error are you getting? What about other samples?

edit : Noticed the error above. Are you able to run other samples?

0 Likes

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

on the line: context = clCreateContextFromType(0, CL_DEVICE_TYPE_GPU, NULL, NULL, &errnum);

It's a runtime error. The samples build/compile fine.

0 Likes

i am on linux. i tried cuda toolkit 3.0 samples.

and clCreateContextFromType(0, CL_DEVICE_TYPE_GPU, NULL, NULL, &errnum);

NULL is not valid platform anymore with ICD. you must specify platform id.

0 Likes

nou,

 So you got the 3.0 samples to build and run fine?

0 Likes

yes. i have instaled my packages. then i download gpucomputingsdk_3.0_linux.run extract it into one director and it work like charm.

most samples run fine. even oclSimpleTexture3D works when i changed CL_R to CL_RGBA (and some other minor changes to use 4 channel textures).

0 Likes
rotor
Journeyman III

0 Likes

Originally posted by: ryta1203 Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

 

on the line: context = clCreateContextFromType(0, CL_DEVICE_TYPE_GPU, NULL, NULL, &errnum);

 

It's a runtime error. The samples build/compile fine.

 

Are you using AMD SDK headers to compile? and you need to change code as per ICD.

0 Likes

I just downloaded gpucomputingsdk 3 and are unable to run the binary or compile the code. It comes up with the error

error PRJ0019: A tool returned an error code from "Compiling with CUDA Build Rule..."

Im guessing its compiling it against the nvidia sdk. How do i change it to use the ati sdk

Cheers

Damian

0 Likes

Both the ATI and NVIDIA SDKs have their own build and demo systems with a hierarchy of Makefiles and common code (I am on Linux, don't know about Windows projects). This can be a little busy and difficult to figure out. It might be easier to create a new project somewhere else and lift the code out.

However, the basic difference is almost seamless. I can switch back and forth between ATI and NVIDIA with these Makefile macros:

ATI_SDK = $(ATISTREAMSDKROOT)
ATI_CFLAGS = -I$(ATI_SDK)/include
ATI_OPENCL_LDFLAGS = -L$(ATI_SDK)/lib/x86_64 -lOpenCL
NVIDIA_SDK = $(NVIDIASDKROOT)
NVIDIA_CFLAGS =
NVIDIA_OPENCL_LDFLAGS = -lOpenCL

Note that ATI installs everything together in a separate location for the Stream SDK. NVIDIA installs into the system /usr directories. It may be analogous on Windows.

For instance, the default build rule I use when compiling against ATI is:

.cpp.o :
        $(GNU_CXX) -c $(GNU_CXXFLAGS) $(ATI_CFLAGS) $< -o $@

to compile against NVIDIA, this becomes:

.cpp.o :
        $(GNU_CXX) -c $(GNU_CXXFLAGS) $(NVIDIA_CFLAGS) $< -o $@

I have only ever found one OpenCL compile-time incompatibility between the ATI and NVIDIA SDKs which was a very minor signature difference. Otherwise, everything just worked out of the box (which still surprises me). Building between the two SDKs to target different GPUs is as little as switching the Makefile macros above.

0 Likes