Is there general purpose GPU support in the Linux kernel?

Let me explain in more details since it's too broad of a topic. By the word "capable" I mean native support. That crosses out OpenGL AND OpenCL as those are just APIs to help code applications in user mode.

Some common misconceptions are that since super computers use GPGPUs and run Linux, then Linux use them. Well, not quite. The Linux distributions running on super computers are often times not the same as the ordinary distributions we know. They are so far modified that they're not Linux but a whole new operating system.

Another famous answer might be the poor support of GPUs. Well, lets not go there and eliminate all other factors be it bottleneck or something else like architecture.

Lets reword the question as follows:

Does the mainline Linux kernel natively utilize stream processing via general purpose registers of a GPU? And if it is, to what extent?

  • 4
    Why must you narrow this to "the kernel" and rule out OpenCL, or CUDA? I mean, what's wrong with running GPGPU apps in user space? The way your question is written, it looks like you're trying to run the GPGPU code in kernel space; if so, I doubt you have as good a justification for it as you think you do. – Warren Young Nov 18 '13 at 5:29
  • While that's not at all how I read the title, based on the "reworded question", I believe they want to know if the kernel itself is capable of using GPUGP. That is, "Given a large list, can we farm out the sorting of it to the GPU?". In which case I believe the answer is definitely no. – user50849 Nov 18 '13 at 11:43

Just a note, the idea of the kernel having to virtualize and context-switch hundreds of GPU registers is horrifying and the kernel is doing nothing that could benefit from using them itself. There is code in the kernel to manage sharing GPU resources among processes (more of that code is migrating into the kernel steadily), and the processes that do share the GPU for computing do it via opencl and cuda and the like, but any GPU context switching they do won't be tied to any CPU thread because see above. I strongly suspect the GPU runs entirely independently and reports its results with a bus report of some kind, CPU-facing register readout or interrupt or whatnot.


The simple answer is no. After some research and code reading myself, I believe the mainline Linux kernel as of version 3.12 has either very few to no support for GPUs general purpose registers. This comes from the decades of CPU centric notion that will need a drastic change if it were to move in the direction of stream processing.

Though, I admit the poor quality of the question, thus, I did not receive a straight forward answer. I still think user50849 came close to answering the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.