Replies: 1 comment
-
I don't have enough knowledge of this but I found some reference might related to this: Convert Cuda memory to LibTorch tensor If you mix those with P/Invoke, it seems able to create Tensor without coping entire data to CPU. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In details, I use Windows Graphics Capture technology to capture specific app window frames. This is equivalent to screen recording, but only for a specific window. You can read this repo if you interest it.
At currently, I copy the frame bitmap(raw RGBA byte array) from GPU to CPU, then create tensor by
torch.tensor(rawRgbaByteArray, ...)
(in other words, copy from CPU to GPU). Obviously this is unnecessary.So, is it possible create
torch.Tensor
fromIDirect3DSurface
directly? That is copy from GPU buffer to another GPU buffer by VRAM copying rather than RAM copying, if I understand correctly.Beta Was this translation helpful? Give feedback.
All reactions