Take the 2-minute tour ×

I am trying to run one algorithm for Polygon Intersection on Tesla C2075.But when I try to compile this algorithm, the compiler is giving me error :"Entry Function 'Polygon_Intersection'uses too much local data(0x40e8 bytes,0x4000).

My algorithm is little bit complex and it make use of lots of local variable inside the kernel. So my question is ,Is there any way to solve this problem like Can I use Global memory for local variable declaration for each kernel or somehow use the shared memory?

share|improve this question
What gpu are you using? If you have a Fermi or Kepler device, you have the option of using dynamically heap memory too. –  talonmies Jul 17 '12 at 19:10
@ talonmies :I am using Tesla C2075 device which is Fermi device.I tried using dynamically heap memory (by using malloc) but it gave compile error saying "host function 'malloc' is not supported). –  uci_grad Jul 17 '12 at 19:52
You need to compile with arch=sm_20for that GPU –  talonmies Jul 17 '12 at 20:06
Did -arch=sm_20 fix your issue, @uci_grad? If not, please post some code so we can help you. –  harrism Sep 11 '12 at 4:39
@harrism : Yes arch=sm_20 solves my issue.Thanks a lot. –  uci_grad Sep 13 '12 at 0:08
add comment

1 Answer

up vote 2 down vote accepted

Compile with -arch=sm_20 to enable device-side malloc so that you can use heap memory for thread-local data.

share|improve this answer
I have same problem , but it gives error sh: g++: not found. I didn't find any information about -arch , can you give some information or help ? also I used it like this nvcc -arch=sm_20 main.cu , It' right or not? :) , thanks regards –  Hayk Nahapetyan Oct 4 '12 at 21:28
This is not the same problem. You need to submit a separate question. It sounds like you have a broken compiler toolchain installation. –  harrism Oct 4 '12 at 22:34
Ok , thank you very much :) –  Hayk Nahapetyan Oct 4 '12 at 22:55
add comment

Your Answer


