On 8/3/19 10:09 AM, Suhail Doshi wrote:
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 GPU:
+-----------------------------------------------------------------------------+
| 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.

The video memory used for the desktop is not directly accessible by the CPU.

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.

CPU-mapped device memory is likely much slower to access than you think, so XShmGetImage is probably much faster than the CPU-mapped approach you're thinking of.

What it sounds like you're looking for is the NVIDIA Capture SDK, which provides an API that applications can use to capture frames into video memory and do on-GPU encoding to H.264 before streaming to system memory.

You can find more information at
https://developer.nvidia.com/capture-sdk

Sincerely,
Aaron

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!

Suhail

--

Founder
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Reply via email to