Why `gpucoder.profile` example failed?
4 views (last 30 days)
Show older comments
I am trying to profile the gpu code. At first, I tried the example in gpucoder.profile. But it always gives an error with something of SIL ServerPort as below. My gpu device is NVIDIA GeForce RTX 2060 SUPER. The host system is windows10 64bits. My Matlab version is 2021a. What's wrong with my gpu device? Could anyone give me some suggestions?
At first, build a gpu_fftn function file in the current directory.
function [Y] = gpu_fftn(X)
coder.gpu.kernelfun();
Y = fftn(X);
end
Then ran the commands below in Matlab prompts window.
cfg = coder.gpuConfig('exe');
cfg.GpuConfig.MallocMode = 'discrete';
gpucoder.profile('gpu_fftn',{rand(2,4500,4)},'CodegenConfig',cfg, ...
'CodegenArguments','-d profilingdir','Threshold',0.001);
The error came in several minutes.
### Starting SIL execution for 'gpu_fftn'
To terminate execution: clear gpu_fftn_sil
UnknownServerPort_Diagnostics - 0
UnknownServerPort_Diagnostics - 1
UnknownServerPort_Diagnostics - 2
Error using gpucoder.profile (line 41)
Could not parse server port number from application output:
To manually test launching the executable run the command line:
C:\Users\psylab706\Documents\MATLAB\ZW\GPU\coder\profilingdir\sil\gpu_fftn.exe -port 0
-blocking 1.
gpuDevice
>> gpuDevice
ans =
CUDADevice with properties:
Name: 'GeForce RTX 2060 SUPER'
Index: 1
ComputeCapability: '7.5'
SupportsDouble: 1
DriverVersion: 11.3000
ToolkitVersion: 11
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 8.5899e+09
AvailableMemory: 7.3862e+09
MultiprocessorCount: 34
ClockRateKHz: 1650000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceSelected: 1
checkGpuInstall
gpuEnvObj = coder.gpuEnvConfig;
gpuEnvObj.GpuId = 0; % the device number is 0, no other device
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
results = coder.checkGpuInstall(gpuEnvObj);
result of checkGpuInstall:
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
Basic Code Generation : PASSED
Basic Code Execution : PASSED
results =
struct with fields:
gpu: 1
cuda: 1
cudnn: 0
tensorrt: 0
basiccodegen: 1
basiccodeexec: 1
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 0
profiling: 0
My had update my nvidia driver to latest version.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/636850/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/636850/image.png)
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Get Started with GPU Coder 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!