CPU-> GPU传输与GPU-> CPU传输 [英] CPU->GPU transfer vs GPU->CPU transfer

查看:168
本文介绍了CPU-> GPU传输与GPU-> CPU传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在做一些有关测量从
CPU-> GPU和GPU-> CPU传输数据的延迟的实验。我发现,对于特定消息大小,CPU-> GPU数据传输速率几乎是GPU-> CPU传输速率的两倍。有人可以解释我为什么会这样吗?

I have been doing some experiments regarding measuring the latency of data transfer from CPU->GPU and GPU->CPU. I found that CPU->GPU data transfer rate is almost twice as much compared to GPU->CPU transfer rate for a particular message size. Can anybody explain me why this is so?

推荐答案

由于不了解实验的详细信息,例如CPU / GPU是什么使用过,如何测量传输速率,我只是猜测,从CPU-> GPU进行
数据传输,通常是通过DMA。每次它可以将一个块字节从系统内存传输到图形内存。
但是从GPU-> CPU进行数据传输,通常CPU是读取由PCI总线映射的图形光圈存储器。 CPU仅能以不可缓存的严格顺序逐字节读取光圈存储器,因此速度很慢。

Since don't know the detail about your experiment, like what's CPU/GPU used, how to measure transfer rate, I just guess that, data transfer from CPU->GPU, normally is through DMA. each time it can transfer a block bytes from system memory to graphic memory. But data transfer from GPU->CPU, normally CPU is to read the graphic aperture memory which is mapped by PCI bus. CPU only can read the aperture memory in un-cacheable, strict order byte by byte, so it is slow.

这篇关于CPU-> GPU传输与GPU-> CPU传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆