How to write PTX instructions in OpenGL in Nvidia?

Generally, CUDA is used for GPGPU purposes, as the compiler will generate the PTX pseudo instructions to be execution/interpreted on the GPU.

And OpenGL is altogether based on the standard OpenGL interface, and all functions calling/parameters passing will ultimately get mmap to the GPU’s memory (via the nvidia kernel module). Correct?

My question is whether it is possible to write PTX instructions and somehow get it mmap into the OpenGL interface, to be executed as PTX instruction stream.

Possible?

Sorry for this mad-man’s mumbling… External Image External Image

Generally, CUDA is used for GPGPU purposes, as the compiler will generate the PTX pseudo instructions to be execution/interpreted on the GPU.

And OpenGL is altogether based on the standard OpenGL interface, and all functions calling/parameters passing will ultimately get mmap to the GPU’s memory (via the nvidia kernel module). Correct?

My question is whether it is possible to write PTX instructions and somehow get it mmap into the OpenGL interface, to be executed as PTX instruction stream.

Possible?

Sorry for this mad-man’s mumbling… External Image External Image

The short answer is no, not possible - how the GPU, CUDA and OpenGL work don’t bear much resemblance to how it seems you are imagining they do.

The short answer is no, not possible - how the GPU, CUDA and OpenGL work don’t bear much resemblance to how it seems you are imagining they do.

Although I have not used it personally, there are OpenGL-CUDA interoperability features that allow CUDA and OpenGL to operate on the same data. I believe this is the only way to use PTX (in the form of a CUDA kernel) to modify OpenGL data. The CUDA Programming Guide has more details.

Although I have not used it personally, there are OpenGL-CUDA interoperability features that allow CUDA and OpenGL to operate on the same data. I believe this is the only way to use PTX (in the form of a CUDA kernel) to modify OpenGL data. The CUDA Programming Guide has more details.