CUDAKernel not recognizing ptx filename.
17 views (last 30 days)
Show older comments
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 Comments
Guilherme
on 25 Mar 2020
I'm getting the same error using the following command to generate the PTX file
nvcc pctdemo_processMandelbrotElement.cu -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\Hostx64\x64" -ptx
Pierre E.
on 26 Apr 2020
The same for me... it seems that the generated .ptx file is empty. It seems to be a nvcc problem
Answers (1)
weui zhang
on 25 Jul 2021
Have you solved this problem?
I meet the same questions to you.But do not solve this.
7 Comments
weui zhang
on 6 Oct 2021
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."
凯仁 解
on 12 Nov 2021
The same for me,and my ptx file has the content:
//
// Generated by NVIDIA NVVM Compiler
//
// Compiler Build ID: CL-24330188
// Cuda compilation tools, release 9.2, V9.2.148
// Based on LLVM 3.4svn
//
.version 6.2
.target sm_30
.address_size 64
See Also
Categories
Find more on GPU Computing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!