CUDAKernel not recognizing ptx filename.
Afficher commentaires plus anciens
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 commentaires
Joss Knight
le 3 Août 2019
How did you compile your PTX file? What commands did you use?
Guilherme
le 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.
le 26 Avr 2020
The same for me... it seems that the generated .ptx file is empty. It seems to be a nvcc problem
Réponses (1)
weui zhang
le 25 Juil 2021
0 votes
Have you solved this problem?
I meet the same questions to you.But do not solve this.
7 commentaires
Linda Koletsou Soulti
le 26 Juil 2021
Hello Weui,
Has the PTX file been created properly with the expected name? A way to inspect the contents of the file is by using the command type followed by the name of the file inside the Command Window:
type filename.ptx
Could you also please let me know what are the commands you use to compile the file to PTX?
Cheers,
Linda
weui zhang
le 26 Juil 2021
I found that the .ptx file has not been generated.
cudaFilename = [specific_filename, '.cu'];
ptxFilename = [specific_filename, '.ptx'];
system(['nvcc -ptx ', cudaFilename, ' --output-file ', ptxFilename]);
kernel = parallel.gpu.CUDAKernel( ptxFilename, cudaFilename );
Linda Koletsou Soulti
le 26 Juil 2021
Hello Weui,
are you sure that the name of the file in specific_filename variable is properly spelled and resides in the folder you are when the system command is executed?
Cheers,
Linda
weui zhang
le 26 Juil 2021
I am sure the questions you mentioned are all correct
Linda Koletsou Soulti
le 26 Juil 2021
Hello Weui,
I will need some additional information to understand the issue you are facing. Does the system command throw any errors? Could you please add the verbose option, too:
system(['nvcc -v -ptx ', cudaFilename, ' --output-file ', ptxFilename]);
Have you tried to compile the file to ptx outside MATLAB? Could you please share some additional information like the .cu file you are trying to compile?
Can you successfully follow the steps in the example in the following link:
Cheers,
Linda
weui zhang
le 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."
凯仁 解
le 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
Catégories
En savoir plus sur Containers dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!