I am trying to profile a CUDA code which is invoked from MATLAB through “mexcuda”. I have Matlab R2016a and CUDA 9.0 versions running on Ubuntu 16.04.
I am trying to profile this setup using Nvidia Visual Profiler. I followed posts related to this topic regarding the nvvp settings and am able to write data from MATLAB to GPU and then profile all the kernels written using CUDA.
The problem I face is that Nvidia profiler gives time details of the CUDA kernels alone. The time taken by computations run in CPU(ie MATLAB) is not shown in the profiler results.
To achieve this I tried options below:
Enable CPU tracing in Nvidia Visual Profiler. But it does not seem to work and profiler runs continuously without termination.
mexcuda -g file.cu This option I thought would support debugging which also did not work
Within Matlab script, enable profiler that is supported by MATLAB’s dedicated profiler (using “profile on”) in file1.m
But none of these options is working. Can anyone suggest how to profile all steps run on MATLAB and CUDA using Nvidia Visual Profiler?
Thanks for your response. I did try to enable the option “Profile execution on CPU”. After enabling when i try to run nvvp again, an error pops up as below:
[b]{Unexpected system error: bang: poll [4] Interrupted system call
Error in mexcuda (line 65)
compilerForMex = mex.getCompilerConfigurations(‘C++’,‘selected’);
Thanks a lot for responding. Please see the attachments for how i linked matlab to nvvp.
I intend to profile CPU functions and CUDA functions using either nvvp or nsight IDE.
In my case, the CPU functions are written using MATLAB. Now to transfer the data from MATLAB to GPU, i use a gateway function mexcuda.
Hope my explanation is clear. Please inform if any additional information is required. I am stuck with this problem for many days.