Why not using GPUs as a CPU?

后端 未结 4 1965
情歌与酒
情歌与酒 2021-02-01 20:28

I know the question is only partially programming-related because the answer I would like to get is originally from these two questions:

Why are CPU cores number so low

相关标签:
4条回答
  • 2021-02-01 21:23

    Because nobody will spend money and time on this. Except for some enthusiasts like that one: http://gerigeri.uw.hu/DawnOS/history.html Dawn now works on GPU-s: with a new OpenCL capable emulator, Dawn now boots and works on Graphics Cards, GPU-s and IGP-s (with OpenCL 1.0). Dawn is the first and only operating system to boot and work fully on a graphics chip.

    0 讨论(0)
  • 2021-02-01 21:27

    Current GPUs lack many of the facilities of a modern CPU that are generally considered important (crucial, really) to things like an OS.

    Just for example, an OS normally used virtual memory and paging to manage processes. Paging allows the OS to give each process its own address space, (almost) completely isolated from every other process. At least based on publicly available information, most GPUs don't support paging at all (or at least not in the way an OS needs).

    GPUs also operate at much lower clock speeds than CPUs. Therefore, they only provide high performance for embarrassingly parallel problems. CPUs are generally provide much higher performance for single threaded code. Most of the code in an OS isn't highly parallel -- in fact, a lot of it is quite difficult to make parallel at all (e.g., for years, Linux had a giant lock to ensure only one thread executed most kernel code at any given time). For this kind of task, a GPU would be unlikely to provide any benefit.

    From a programming viewpoint, a GPU is a mixed blessing (at best). People have spent years working on programming models to make programming a GPU even halfway sane, and even so it's much more difficult (in general) than CPU programming. Given the difficulty of getting even relatively trivial things to work well on a GPU, I can't imagine attempting to write anything even close to as large and complex as an operating system to run on one.

    0 讨论(0)
  • 2021-02-01 21:28

    Usually operating systems are pretty simple, if you look at their structure. But parallelizing them will not improve speeds much, only raw clock speed will do.

    GPU's simply lack parts and a lot of instructions from their instruction sets that an OS needs, it's a matter of sophistication. Just think of the virtualization features (Intel VT-x or AMD's AMD-v).

    GPU cores are like dumb ants, whereas a CPU is like a complex human, so to speak. Both have different energy consumption because of this and produce very different amounts of heat.

    See this extensive superuser answer here on more info.

    0 讨论(0)
  • 2021-02-01 21:29

    GPUs are designed for graphics related processing (obviously), which is inherently something that benefits from parallel processing (doing multiple tasks/calculations at once). This means that unlike modern CPUs, which as you probably know usually have 2-8 cores, GPUs have hundreds of cores. This means that they are uniquely suited to processing things like ray tracing or anything else that you might encounter in a 3D game or other graphics intensive activity.

    CPUs on the other hand have a relatively limited number of cores because the tasks that a CPU faces usually do not benefit from parallel processing nearly as much as rendering a 3D scene would. In fact, having too many cores in a CPU could actually degrade the performance of a machine, because of the nature of the tasks a CPU usually does and the fact that a lot of programs would not be written to take advantage of the multitude of cores. This means that for internet browsing or most other desktop tasks, a CPU with a few powerful cores would be better suited for the job than a GPU with many, many smaller cores.

    Another thing to note is that more cores usually means more power needed. This means that a 256-core phone or laptop would be pretty impractical from a power and heat standpoint, not to mention the manufacturing challenges and costs.

    0 讨论(0)
提交回复
热议问题