0
48KB 데이터 블록 (고정 메모리 사용)을 전송 중이며 cuda 이벤트는 5GB/초로 증가하지만 Windows로 돌아갈 때에는 절반 만 볼 수 있습니다. 속도. 이것은 단지 피할 수없는 운전자 오버 헤드입니까, 아니면 이것을 완화 할 수있는 방법이 있습니까? 아래의 테스트 프로그램에서 프로세스를 캡슐화했습니다.이벤트를 사용하는 CUDA 전송 타이밍 대 windows
void transferUp(size_t size)
{
StopWatchWin timer;
timer.start();
float tUpCopyStart,tUpCopyStop;
cudaEvent_t sendUpStopEvent,sendUpStartEvent;
checkCudaErrors(cudaEventCreate(&sendUpStartEvent));
checkCudaErrors(cudaEventCreate(&sendUpStopEvent));
unsigned *cpu_sending = (unsigned *)malloc(size);
checkCudaErrors(cudaHostAlloc(&cpu_sending, size*sizeof(unsigned), cudaHostAllocPortable));
unsigned *gpu_receiving;
checkCudaErrors(cudaMalloc(&gpu_receiving, size*sizeof(unsigned)));
tUpCopyStart = timer.getTime();
checkCudaErrors(cudaEventRecord(sendUpStartEvent));
checkCudaErrors(cudaMemcpyAsync(gpu_receiving, cpu_sending, size*sizeof(unsigned), cudaMemcpyHostToDevice));
checkCudaErrors(cudaEventRecord(sendUpStopEvent));
checkCudaErrors(cudaEventSynchronize(sendUpStopEvent));
tUpCopyStop = timer.getTime();
double sendTimeWindows = tUpCopyStop - tUpCopyStart;
float sendTimeCuda;
checkCudaErrors(cudaEventElapsedTime(&sendTimeCuda,sendUpStartEvent,sendUpStopEvent));
float GbSec_cuda = (size*sizeof(unsigned)/1000)/(sendTimeCuda*1000);
float GbSec_win = (size*sizeof(unsigned)/1000)/(sendTimeWindows*1000);
printf("size=%06d bytes eventTime=%.03fms windowsTime=%0.3fms cudaSpeed=%.01f gb/s winSpeed=%.01f gb/s\n",
size*sizeof(unsigned),sendTimeCuda,sendTimeWindows,GbSec_cuda,GbSec_win);
checkCudaErrors(cudaEventDestroy(sendUpStartEvent));
checkCudaErrors(cudaEventDestroy(sendUpStopEvent));
checkCudaErrors(cudaFreeHost(cpu_sending));
checkCudaErrors(cudaFree(gpu_receiving));
}
TCC에서 실행 중이십니까? –
Tiny C 컴파일러? 아니요, Visual Studio 2010입니다. – sedona2222
@ sedona2222 : TCC = Tesla Compute Cluster, Windows 플랫폼의 CUDA 용 전용 비 디스플레이 드라이버 – talonmies