Can X11 return an image with an NVIDIA GPU memory address?

Suhail Doshi suhail at
Sat Aug 3 17:09:53 UTC 2019

Hi there,

My goal is to try get the frame of a desktop to do low-latency remote
desktop. I am interested in using X11 as the window manager.

When I run nvidia-smi, I noticed that X11 is a process that interacts the
| Processes:                                                       GPU
Memory |
|  GPU       PID   Type   Process name                             Usage
|    0      3255      G   /usr/lib/xorg/Xorg
 57MiB |
|    0      3286      G   /usr/bin/gnome-shell
 81MiB |

My question is: Is there a way to get an image of the desktop that returns
a pointer that's GPU memory? For example, in Windows 10, there's an API
called the Desktop Duplication API which will allows you to do this. Then,
it lets you copy the data in that GPU memory block to another one such that
you can encode the frame with H264, for example. I am using NVIDIA GPUs and
utilizing their NVENC SDK.

I am looking for an equivalent.

Right now, it appears that XShmGetImage returns the frame of the desktop in
host memory versus device memory which increases latency by 5-10ms. For our
purposes, a reduction of 5ms is meaningful.

Should I use kernel-level APIs like interacting with Direct Rendering
Manager and Kernel Mode Setting to accomplish this instead?

Just looking for options. Thanks!



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the xorg mailing list