解决图形芯片最直接的方法是什么? [英] What is the most direct way of addressing a graphics chip?

查看:63
本文介绍了解决图形芯片最直接的方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的老式PC上装有Intel HD 420.

My oldish PC has an Intel HD 420 in it.

我想知道-我们可以使用汇编代码通过muladd等命令直接寻址CPU.

I was wondering - we can use Assembly code to address the CPU directly, with commands like mul, add etc.

如何将程序集计算命令传递给图形芯片(例如Intel HD),或者说"gpu部件"? AMD的Ryzen?它与ARM图形芯片的机制相同吗?

How can I pass on Assembly calculation commands to a graphics chip such as the Intel HD, or say the "gpu part" of AMD's Ryzen? Is it the same mechanics as for an ARM graphics chip?

(没有用于apu,板载图形,intel-hd和ryzen的标签)

(No tags for apu, onboard-graphics, intel-hd, ryzen)

我了解OpenCL是正确的方法,并且就通信而言,板载芯片与任何其他外围硬件(例如打印机)一样好. 但是,出于理论上的好奇心,寻找最简单的汇编代码片段,该操作可以在板载图形芯片(如Intel HD XXX)上进行任何平凡的计算.

I understand that OpenCL is the correct approach, and that an on-board chip is as good as any other peripheral hardware (eg printer) as far as communication. However, out of theoretical curiosity, looking for the simplest Assembly snippet, that does any sort of mundane calculation on an onboard graphics chip like an Intel HD XXX.

推荐答案

GPU是一个单独的内核,您只能通过MMIO与之交互;它不是x87最初的协处理器(fmul在单独的芯片上运行).您可以像图形驱动程序一样访问它.

The GPU is a separate core you can only interact with via MMIO; it's not a coprocessor like x87 originally was (where fmul ran on a separate chip). You can access it the same way the graphics drivers do.

由于没有完全耦合的 ,没有CPU指令可以直接在GPU上执行操作,因此,高延迟是GPGPU的问题.将工作发送到GPU看起来就像是存储到内存中,然后将指向该物理内存的指针传递给GPU,例如通过mov [mem], rax或其他方式到达GPU的MMIO寄存器之一的地址.

There is no CPU instruction that does stuff on the GPU directly because it's not tightly-coupled at all, hence the high latency being a problem for GPGPU. Sending work to the GPU looks like storing to memory and then passing a pointer to that physical memory to the GPU, e.g. via mov [mem], rax or something to the address of one of the GPU's MMIO registers.

对于Intel而言,如果您真的想深入了解Linux DRM(直接渲染管理器)和X11驱动程序,那么这些资源就是开源的.X11驱动程序在要求内核访问后与GPU通讯.

For Intel, those are open source if you really want to dive in to Linux DRM (direct rendering manager) and X11 drivers that talk to the GPU after asking the kernel for access.

这篇关于解决图形芯片最直接的方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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