Allocate memory in GPU instead of CPU

Hi,

I need to allocate memory in GPU instead of CPU (in a c++ code). Can someone give me necessary steps to do that.

Regards,

If you are looking for RAM physically in the GPU, none exists since it isn’t PCIe (the Jetson GPU is wired directly to the memory controller and shares the same memory as the CPU). This document will be of interest (there is a code example in it):
[url]https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#cuda-c-runtime[/url]

This thread explains more:
[url]https://devtalk.nvidia.com/default/topic/932957/zero-copy-and-managedmemory-%20on-jetson/?offset=2[/url]

Jetson has iGPU that makes impossible to use some approaches that are used with discrete GPU’s

Hi,
Thanks linuxdev and Andrey1984 for your replies. What I need exactly is to allocate gpu memory when using buffers in MMAPI instead of cpu memory to see if that can reduce the latency of codec. Don’t know if that is possible !!

Regards,

I couldn’t say what is needed nor how latency might change :(