永发信息网

为什么在Matlab中调用gpu每次都要等很久

答案:1  悬赏:30  手机版
解决时间 2021-01-30 21:40
  • 提问者网友:沉默菋噵
  • 2021-01-30 07:43
为什么在Matlab中调用gpu每次都要等很久
最佳答案
  • 五星知识达人网友:山君与见山
  • 2021-01-30 08:58
Multiple GPUs on the desktop and computer clusters
using MATLAB workers in Parallel Computing Toolbox and MATLAB
Distributed Computing Server

如果你使用MATLAB的CPU并行应该知道matlabpool
当前,在matlab中如果调用多GPU那么需要开启多个pool,一个pool对应一个GPU,也就是一个CPU worker对应一块GPU,如
matlabpool 2
spmd
gpuDevice
end

spmd
if labindex ==1
gpuDevice(2);
end
end

spmd
gpuDevice
end

Lab 1:

ans =

CUDADevice with properties:

Name: 'Quadro FX 370'
Index: 2
ComputeCapability: '1.1'
SupportsDouble: 0
DriverVersion: 5.5000
ToolkitVersion: 5
MaxThreadsPerBlock: 512
MaxShmemPerBlock: 16384
MaxThreadBlockSize: [512 512 64]
MaxGridSize: [65535 65535 1]
SIMDWidth: 32
TotalMemory: 268435456
FreeMemory: NaN
MultiprocessorCount: 2
ClockRateKHz: 720000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 0
DeviceSelected: 1

Lab 2:

ans =

CUDADevice with properties:

Name: 'Tesla K20c'
Index: 1
ComputeCapability: '3.5'
SupportsDouble: 1
DriverVersion: 5.5000
ToolkitVersion: 5
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 5.0330e+09
FreeMemory: 4.9166e+09
MultiprocessorCount: 13
ClockRateKHz: 705500
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 0
CanMapHostMemory: 1
DeviceSupported: 1
DeviceSelected: 1
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯