Problem allocating KMS memory -DRM_IOCTL_MODE_CREATE_DUMB

Hello,
I’m trying to build a sample Qt application on apalis-imx6q with apalis evaluation board.
And I’m using visual studio code with docker for development and deploying an application.
I’m using torizoncore image (toradex_5.4.y)
But I’m experiencing an error saying
“DRM_IOCTL_MODE_CREATE_DUMB failed: cannot allocate memory”
“etna_resource_alloc:284: Problem allocating kms memory for resource”

so it looks like a memory issue. I’ve also done some research on my own about this and it looks this is related to GPU.

I also tried building a reference image from yocto instead using torizon os (Build a Reference Image with Yocto Project/OpenEmbedded | Toradex Developer Center).
and experience error while building related to binutils.

I want to know how can I debug this to be sure what’s happening and how I can resolve that.


Please find a screenshot with error for your reference, might help you.

Please let me know how to check the resource consumption and usage related to video buffers and memory.

Any help will be appreciated.

Thanks
Gaurav C.

Greetings @gaurav,

Yeah this seems like a GPU memory issue based on the error you got. First of all what version of TorizonCore are you running? You mentioned the kernel version (5.4) but what version of the OS itself?

One thing you can try is adjusting the “Continuous Memory Allocation” (CMA) on the image. This will adjust how much of the system memory is allocated to the GPU as well. Please see the article here for more info on this topic: Contiguous Memory Allocator - CMA (Linux) | Toradex Developer Center

Best Regards,
Jeremias

Thanks @jeremias.tx this worked and there is an improvement.
I’ve increased memory using kernel arguments.
By the way kernel version as you asked is “5.4.129-5.4.0+git.ce72bea42c97”
Can you please tell me how can we check resource consumption and monitor them, I mean CMA memory buffers etc in torizoncore.

Thanks
Gaurav C.

Glad to hear it was a simple matter of increasing the amount of memory allocated to CMA.

Can you please tell me how can we check resource consumption and monitor them, I mean CMA memory buffers etc in torizoncore.

One thing you could do is parse /proc/meminfo like so:

cat /proc/meminfo | grep Cma
CmaTotal:        1015808 kB
CmaFree:          752384 kB

It has some basic CMA information as seen above. Though I’m not sure if you were looking for something more detailed than this.

Best Regards,
Jeremias

1 Like

Thanks @jeremias.tx

Glad I could help.