cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

twentz
Journeyman III

CPU JIT problem

For CPU only, building kernel returns CL_INVALID_KERNEL_NAME

On a 64-bit Windows 7, I have used both the MinGW (32-bit) and Cygwin toolchains to compile OpenCL code -- and it compiles fine and executes fine on my 2 GPUs (discrete Radeon HD 6770 and APU-integrated 6550), but whenever I choose the CPU as the device (A8-3850), building the kernel fails and returns the error code CL_INVALID_KERNEL_NAME and the build log doesn't contain any information, just "Internal Error:  as failed " (presumably there are strings missing or overwritten).

While I was working on getting everything compiled, I observed that some of the host function names were a little odd -- like "main@32" or something, so this might be an oddity of Windows that contorts function names -- but I have no idea how to adjust for this (since I can't find any sort of "verbose" compilation option for AMD's platform like -v or -cl-nv-verbose )

Also, I don't know if the problem has something to do with 32-bitness -- the CPU and OS are 64-bit, but whenever I try to compile something with cygwin's GCC or MinGW, it gives me an "unimplemented 64-bit mode" even though it appears I have the 64-bit compilers installed and I am specifying the -m64 flag.  Of course, compiling and running the host application with -m32 works -- and the Kernels can execute on the [32-bit] GPUs

 

Any help on how to find out what could be wrong with the kernel name? (Vanilla OpenCL C, same directory, works as expected with GPU but not CPU)

0 Likes
7 Replies
genaganna
Journeyman III

Originally posted by: twentz On a 64-bit Windows 7, I have used both the MinGW (32-bit) and Cygwin toolchains to compile OpenCL code -- and it compiles fine and executes fine on my 2 GPUs (discrete Radeon HD 6770 and APU-integrated 6550), but whenever I choose the CPU as the device (A8-3850), building the kernel fails and returns the error code CL_INVALID_KERNEL_NAME and the build log doesn't contain any information, just "Internal Error:  as failed " (presumably there are strings missing or overwritten).

While I was working on getting everything compiled, I observed that some of the host function names were a little odd -- like "main@32" or something, so this might be an oddity of Windows that contorts function names -- but I have no idea how to adjust for this (since I can't find any sort of "verbose" compilation option for AMD's platform like -v or -cl-nv-verbose )

Also, I don't know if the problem has something to do with 32-bitness -- the CPU and OS are 64-bit, but whenever I try to compile something with cygwin's GCC or MinGW, it gives me an "unimplemented 64-bit mode" even though it appears I have the 64-bit compilers installed and I am specifying the -m64 flag.  Of course, compiling and running the host application with -m32 works -- and the Kernels can execute on the [32-bit] GPUs

 Any help on how to find out what could be wrong with the kernel name? (Vanilla OpenCL C, same directory, works as expected with GPU but not CPU)

Could you please run SDK sample(Reduction) on CPU and see whether it is running or not?

You can find prebuilt binaries in SDK installed folder.

0 Likes

Using the pre-built one, It failed with the same build log error, but with a different error code (not sure why it failed at a different point, maybe I wasn't checking mine early enough):

Commandline (cygwin):

.../bin/x86_64

$ ./Reduction.exe --device cpu

...

Device 0 : AMD A8-3850 APU with Radeon(tm) HD Graphics

 

    BUILD LOG

 ***********************

Internal Error:  as failed

 

 ***********************

Error: clBuildProgram failed. Error code : CL_BUILD_PROGRAM_FAILURE

 

But, of course, it ran on both the GPU devices.  If it's trying to call some internal compiler, then it might not be present as I don't have Visual Studio installed.  And if it matters any, whenever I do the "X86 Assembly" option on the AMD Kernel Analyzer, it doesn't work since it's not finding the ISA or compiler or something.

 

Everything runs fine on 64-bit Linux -- but the multi-GPU install didn't work for me (I tried repeatedly with different configurations), so I need to use Windows if I want to use both GPUs (but now it looks like I can't use the CPU on Windows).

 

This was the latest software as of a few days ago:

SDK v2.5

(Graphics card)

Driver 8.881-110728a-124445C-ATI

Catalyst 11.8

0 Likes

Originally posted by: twentz Using the pre-built one, It failed with the same build log error, but with a different error code (not sure why it failed at a different point, maybe I wasn't checking mine early enough):

Commandline (cygwin):

.../bin/x86_64

$ ./Reduction.exe --device cpu

...

Device 0 : AMD A8-3850 APU with Radeon(tm) HD Graphics

     BUILD LOG

 ***********************

Internal Error:  as failed

  ***********************

Error: clBuildProgram failed. Error code : CL_BUILD_PROGRAM_FAILURE

 But, of course, it ran on both the GPU devices.  If it's trying to call some internal compiler, then it might not be present as I don't have Visual Studio installed.  And if it matters any, whenever I do the "X86 Assembly" option on the AMD Kernel Analyzer, it doesn't work since it's not finding the ISA or compiler or something.

 Everything runs fine on 64-bit Linux -- but the multi-GPU install didn't work for me (I tried repeatedly with different configurations), so I need to use Windows if I want to use both GPUs (but now it looks like I can't use the CPU on Windows).

 This was the latest software as of a few days ago:

SDK v2.5

(Graphics card)

Driver 8.881-110728a-124445C-ATI

Catalyst 11.8

Can you run from windows command line?  No dependency with Visual studio.

0 Likes

Interesting. Running from the Windows commandline worked -- but only for the pre-built binaries. The Cygwin and MinGW built binaries aren't working, so I'm trying to fix the not-supposed-to-be-a-problem that it won't compile for 64 bit since that's the only thing I could imagine being the problem.

0 Likes

I found the 64-bit compilers for MinGW (which also does not rely on cygwin1.dll), but this did not resolve the problem, even from the Windows command prompt

0 Likes

Originally posted by: twentz I found the 64-bit compilers for MinGW (which also does not rely on cygwin1.dll), but this did not resolve the problem, even from the Windows command prompt

Twentz,

Please use MinGW for 32 bit build and MinGW64 for 64 bit build and let me know you are able to run on CPU or not.

 

 

0 Likes

That is what I tried when I said that: I tried 32 and 64 bit builds, and neither worked.

I just wasted a couple hours trying to build the project in Visual Studio 2010, but I encountered the exact same error for 32-bit builds (GPU works fine, CPU fails at the OpenCL compiler), and Microsoft does an exceedingly good job of obfuscating how to compile for 64-bit, so I am unable to try that.

0 Likes