cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sgratton
Adept I

Are the targets in calclCompile limited by the card in one's machine?

Strange behaviour with Win 7 64-bit home premium, 4870, cal 11.1, vs2010 express

 

Hi there,

 

I've been trying to compile some shaders on a home machine with a 4870 in it using vs2010 express.  I know this is unsupported, but it works in many cases but fails in a strange way which leads me to suspect that the cause may be elsewhere.

 

If I compile a pixel shader with any target (770, CYPRESS, CAYMAN), things work fine.  But compute shaders will only compile with a 770 target.  See the attached code and try changing kern to/from test1/test2 and playing with the target.  Note I'm only compiling, not trying to run anything.

Has anybody else seen anything like this?  Is somehow the compiler implicitly being restricted by the driver installed on the machine?  Is this a bug?  Or is it something else and I am just unlikely?

 

Thanks,

Steven.

 

 

 

#include <iostream> #include <calcl.h> using namespace std; const char test1[]="il_ps_2_0 \n" "end \n"; const char test2[]="il_cs_2_0 \n" "end \n"; void disp(const char* msg) { cout << msg; } int main() { CALuint version[3]; calclGetVersion(&version[0], &version[1], &version[2]); fprintf(stderr, "CAL Compiler version %d.%d.%d\n", version[0], version[1], version[2]); const char* kern=test2; //Nb. test1 is okay for all cal_targets... cout << endl << kern << endl; CALobject obj=NULL; CALresult err =calclCompile(&obj,CAL_LANGUAGE_IL,kern,CAL_TARGET_CYPRESS); cout << "Err: " << err << ", " << calclGetErrorString() << endl; CALimage img=NULL; calclLink(&img,&obj,1); calclDisassembleImage(img,disp); return 0; }

0 Likes
4 Replies
sgratton
Adept I

 

Hi there,

 

I've now tried it on another machine (vista 64 with 6950), this time with the 32-bit cl.exe from VS2010express  and the 64-bit cl.exe from Windows sdk 7.1.  Unfortunately the problem with compiling compute shaders for recentish cards still seems to be there.  The command line I used was

cl /EHsc main.cpp /I "\Program Files (x86)\A
TI Stream\include" /link /LIBPATH:"\Program Files (x86)\ATI Stream\lib" aticalcl.lib

for the 32-bit version and a similar one for the 64-bit version.

 

The error one receives from the program in the troublesome cases is:

Err: 1, Error Creating program info

 

So it seems that the card in the machine doesn't affect the issue.  Perhaps there is a bug somewhere.

 

Any advice much appreciated,

Steven.

 

0 Likes

 

Hi there,

 

Just in case anyone else is interested, it seems that compute shaders for cypress/cayman will in fact compile if the number of threads per group is explicitly declared.  So:

 

il_cs

dcl_num_thread_per_group 8,8,1

end

 

will in fact work.  This suggests to me that there is an issue with the compiler in handling arbitrary-size thread groups in a compute shader.  The strange thing is it manages okay with a pixel shader. 

 

Best,

Steven.

 

 

0 Likes

sgratton,
For compute shader, the number of threads per group is a requirement. If you don't know the size at compile time, use dcl_max_thread_per_group N to get the largest that will be executed.
0 Likes

 

Dear Micah,

 

Thanks for your reply.  The dcl_max_thread_per_group N did the trick. I didn't realise this had to be fixed on the newer cards.  The SKA was confusing me in that it doesn't seem to need that line to successfully compile for the newer architectures.

 

Best wishes,

Steven.

  

0 Likes