我正在测试GPU编码是否在MATLAB中有效。 我发现每次在第一次打开MATLAB后运行gpuDevice命令时,都需要很长时间。
tic
var = gpuDevice()
toc
>> gpu_test
至少需要100秒或更长时间:
var =
CUDADevice with properties:
Name: 'GeForce GTX 1060'
Index: 1
ComputeCapability: '6.1'
SupportsDouble: 1
DriverVersion: 8
ToolkitVersion: 7.5000
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 6.4425e+09
AvailableMemory: 5.3035e+09
MultiprocessorCount: 10
ClockRateKHz: 1670500
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceSelected: 1
Elapsed time is 108.818430 seconds.
事情是在第一次之后,相同的脚本需要0.5~1ms才能运行。 每次启动MATLAB时运行时都会重置。是否每次都要预期这种长运行时间?
谢谢, CN