why the command coder.chec​kGpuInstal​l(envCfg) failed in a CPU worker

2 Ansichten (letzte 30 Tage)
I work with MATLAB R2020a, windows 10, P2000 Nvidia card. This code work properly launched from the command window :
function [envCfg, results, results1] = gpuDeviceInWorker()
envCfg = coder.gpuEnvConfig('host');
envCfg.BasicCodegen = 1;
envCfg.BasicCodeexec = 1;
envCfg.DeepCodegen = 0;
envCfg.DeepCodeexec = 0;
envCfg.Quiet = 1;
license checkout GPU_Coder
test = ans;
license checkout Matlab_Coder
test = test + ans;
try
results1 = test;
results = coder.checkGpuInstall(envCfg);
catch ME
results = ME;
end
end
This results :
[envCfg, results, results1] = gpuDeviceInWorker
ans =
1
ans =
1
envCfg =
gpuEnvConfig with properties:
Hardware: 'host'
GpuId: 0
BasicCodegen: 1
BasicCodeexec: 1
DeepCodegen: 0
DeepCodeexec: 0
DeepLibTarget: ''
DataType: ''
GenReport: 0
Quiet: 1
CudaPath: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2'
CudnnPath: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\cuda'
Profiling: 0
NvtxPath: 'C:\Program Files\NVIDIA Corporation\NvToolsExt\'
TensorrtPath: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\TensorRT-5.1.5.0'
results =
struct with fields:
gpu: 1
cuda: 1
cudnn: 0
tensorrt: 0
basiccodegen: 1
basiccodeexec: 1
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 0
profiling: 0
results1 =
2
But when i try to do :
c = parcluster('GPUclusterTest')
c =
Local Cluster
Properties:
Profile: GPUclusterTest
Modified: false
Host: B496915E0F22
NumWorkers: 24
NumThreads: 1
JobStorageLocation: C:\Users\adm.mle_grand\AppData\Roaming\MathWorks\MATLAB\local_cluster_jobs\R2020a
RequiresOnlineLicensing: false
Associated Jobs:
Number Pending: 0
Number Queued: 0
Number Running: 0
Number Finished: 0
then :
job = batch(c,@gpuDeviceInWorker,3)
job =
Job
Properties:
ID: 67
Type: independent
Username: adm.mle_grand
State: running
SubmitDateTime: 14-Oct-2020 14:27:16
StartDateTime:
Running Duration: 0 days 0h 0m 0s
NumThreads: 1
AutoAttachFiles: true
Auto Attached Files: List files
AttachedFiles: D:\Matlab\GPU\Benchmark_Mandelbrot
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\cuda
AutoAddClientPath: true
AdditionalPaths: 18 paths
Associated Tasks:
Number Pending: 1
Number Running: 0
Number Finished: 0
Task ID of Errors: []
Task ID of Warnings: []
wait(job)
results = fetchOutputs(job)
results =
1×3 cell array
{1×1 coder.gpuEnvConfig} {1×1 MException} {[0]}
results{2}
ans =
MException with properties:
identifier: 'gpucoder:system:gpu_sys_check'
message: 'One or more of the system checks did not pass, with the following errors ...↵Basic Code Generation: (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)'
cause: {}
stack: [10×1 struct]
Correction: []
When i click on "view report", i have this answer :
There is no access to GPU Coder and MATLAB Coder licences from the job in the worker.
Did someone have an idea to solve this problem ?
Thanks

Akzeptierte Antwort

Mikaël LE GRAND
Mikaël LE GRAND am 15 Okt. 2020
Hi Raymond,
I understand my error now. Your solution works just fine.
thanks a lot
Mikael

Weitere Antworten (3)

Raymond Norris
Raymond Norris am 15 Okt. 2020
Hi Mikaël,
MATLAB Coder and GPU Coder can be used by workers in interactive sessions (i.e. parpool). See more about what other products require interactive parpool sessions
as well as products not eligible to run in workers
Thanks,
Raymond

Mikaël LE GRAND
Mikaël LE GRAND am 15 Okt. 2020
Bearbeitet: Mikaël LE GRAND am 15 Okt. 2020
Hi Raymond,
first thanks for your answer. If i well understood your advice, I have to create a parpool objet (which should be interactive) in a cluster to have licenced worker with GPU Coder and MATLAB coder :
"Interactive Support for Transformation Programs
Use of MATLAB Coder, Simulink Coder, Embedded Coder, GPU Coder, HDL Coder, Filter Design HDL Coder, Simulink PLC Coder, Simulink Design Verifier, and Simulink Code Inspector, are only available through interactive parpool sessions."
So, here is my cluster :
So, i begin to create a cluster objet :
c = parcluster('GPUclusterTest')
c =
Local Cluster
Properties:
Profile: GPUclusterTest
Modified: false
Host: B496915E0F22
NumWorkers: 24
NumThreads: 1
JobStorageLocation: C:\Users\adm.mle_grand\AppData\Roaming\MathWorks\MATLAB\local_cluster_jobs\R2020a
RequiresOnlineLicensing: false
Associated Jobs:
Number Pending: 0
Number Queued: 0
Number Running: 0
Number Finished: 0
Then i create a parpool objet :
parpool('GPUclusterTest', 1)
Starting parallel pool (parpool) using the 'GPUclusterTest' profile ...
Connected to the parallel pool (number of workers: 1).
ans =
ProcessPool with properties:
Connected: true
NumWorkers: 1
Cluster: GPUclusterTest
AttachedFiles: {}
AutoAddClientPath: true
IdleTimeout: 30 minutes (30 minutes remaining)
SpmdEnabled: true
finally, i launch my job on my cluster :
job = batch(c,@gpuDeviceInWorker,3)
job =
Job
Properties:
ID: 75
Type: independent
Username: adm.mle_grand
State: running
SubmitDateTime: 15-Oct-2020 12:42:23
StartDateTime:
Running Duration: 0 days 0h 0m 0s
NumThreads: 1
AutoAttachFiles: true
Auto Attached Files: List files
AttachedFiles: {}
AutoAddClientPath: true
AdditionalPaths: 22 paths
Associated Tasks:
Number Pending: 1
Number Running: 0
Number Finished: 0
Task ID of Errors: []
Task ID of Warnings: []
wait(job)
results = fetchOutputs(job)
results =
1×3 cell array
{1×1 coder.gpuEnvConfig} {1×1 MException} {[0]}
So we can see any change in the result. GPU Coder and MATLAB coder licencing is still not valide
results{3}
is still equal to 0 which confirm that the commands in "gpuDeviceInWorker.m" function
license checkout GPU_Coder
license checkout Matlab_Coder
return each 0
What am i doing wrong ? Really need some help to access GPU from cluster's worker...
  1 Kommentar
Raymond Norris
Raymond Norris am 15 Okt. 2020
Hi Mikaël,
There's a slight confusion. You either run an interactive parallel job (parpool) or a non-interactive parallel job (batch). Now that you have a parallel pool running, you can run your code in a spmd block. For instance
parpool('GPUclusterTest', 1);
spmd
[envCfg, results, results1] = gpuDeviceInWorker()
end
This will run gpuDeviceInWorker on the single worker running in the pool on your cluster.
Raymond

Melden Sie sich an, um zu kommentieren.


Mikaël LE GRAND
Mikaël LE GRAND am 15 Okt. 2020
Raymond,
i understand my error now. Your solution works just fine.
Thnaks a lot for your help.
Mikael

Kategorien

Mehr zu Parallel Computing Fundamentals finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by