MATLAB Answers

CUDAKernel not recognizing ptx filename.

조회 수: 11(최근 30일)
Martin Kuhnel
Martin Kuhnel 2019년 7월 31일
댓글: weui zhang 2021년 10월 6일 7:02
Hello,
I am attempting to use a CUDA function written in a file called 'cluster.cu' and compiled to 'cluster.ptx' in matlab. It worked fine the first time I tried it, but ever since then I get the following error:
"Error using parallel.internal.gpu.handleKernelArgs
The first input to parallel.gpu.CUDAKernel must be the name of a file that contains PTX code or an array containing PTX code."
Here is a snippet of the code involved:
cudaname = 'cluster.cu';
ptxname = 'cluster.ptx';
kernel = parallel.gpu.CUDAKernel(ptxname,cudaname);
I am not sure what I am doing wrong here. I am passing it the name of a ptx file. Any ideas?
  댓글 수: 3
Pierre E.
Pierre E. 2020년 4월 26일
The same for me... it seems that the generated .ptx file is empty. It seems to be a nvcc problem

댓글을 달려면 로그인하십시오.

답변(1개)

weui zhang
weui zhang 2021년 7월 25일
Have you solved this problem?
I meet the same questions to you.But do not solve this.
  댓글 수: 6
weui zhang
weui zhang 2021년 10월 6일 7:02
if single_yes
specific_filename = 'cuda/calculate_tensors_single';
else
specific_filename = 'cuda/calculate_tensors_double';
end
cudaFilename = [specific_filename, '.cu'];
ptxFilename = [specific_filename, '.ptx'];
system(['nvcc -ptx ', cudaFilename, ' --output-file ', ptxFilename]);
kernel = parallel.gpu.CUDAKernel( ptxFilename, cudaFilename );
The above is my code, it still mentioned "Error using parallel.internal.gpu.handleKernelArgs
The first input to parallel.gpu.CUDAKernel must be the name of a file that contains PTX code or an array containing PTX code."

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by