CUDA toolkit version | using constant memory

3 ビュー (過去 30 日間)
m4 Chrennikov
m4 Chrennikov 2012 年 3 月 21 日
Hi
I've installed CUDA toolkit 4.1 instead of 4.0. And now matlab reports some errors depending on kernel that Im trying to create:
Error using handleKernelArgs (line 48)
The first input to parallel.gpu.CUDAKernel must be a file that contains PTX code or a string that is PTX code.
Error using handleKernelArgs (line 61)
No entries were found in the PTX file
NVIDIA is using new compiler in 4.1, and it seems to me that pct does not support it. Am I right? It is unclear for user which version of toolkit should he use. Maybe I missed something, but I could not find toolkit version requirements.
The second question is about using constant memory. Help says that user should define constant variables in CU file
__constant__ int N;
__constant__ double CONST_DATA[256];
Placing such definition in kernel does not work:
error: a "__constant__" variable declaration is not allowed inside a function body

採用された回答

Ben Tordoff
Ben Tordoff 2012 年 3 月 22 日
Hi, I will tackle the second question first as I am pretty certain of the problem. _constants_ must be defined at the global scope, i.e. not inside functions, classes etc. So, for example,
__constant__ double CONST_DATA[256];
__global__ void myKernel(double * out, double * in) {
// Some code
}
is fine, whilst
__global__ void myKernel(double * out, double * in) {
__constant__ double CONST_DATA[256];
// Some code
}
is not. If you already have your constants at global scope then there must be something else amiss. In that case, perhaps you could post some short CU code that shows the problem?
Regarding your first question, I'm afraid I don't have a definite answer. I've just tried compiling a simple kernel to PTX using NVCC from CUDA 4.1 with MATLAB R2012a and it worked fine. However this may depend on the compile options specified. Perhaps you could provide some details about which MATLAB release you are using, what compile command you used, and maybe even a short snippet of code that will help me to understand the problem?
Thanks.
Ben
  5 件のコメント
Ben Tordoff
Ben Tordoff 2012 年 4 月 19 日
A fix for the "no entries" problem is now available:
http://www.mathworks.com/support/bugreports/814923
Can you try it and let me know if you still have problems?
m4 Chrennikov
m4 Chrennikov 2012 年 4 月 23 日
Ben everything seems to be fine. Ill post additionally if something happens.
Thanks!

サインインしてコメントする。

その他の回答 (1 件)

Matthew
Matthew 2012 年 5 月 21 日
the problem is still there .
nvcc -ptx -arch=sm_20 xxx.cu with cuda4.1 & 4.2 it run on ubuntu 11.10
matlab 2011b

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by