High VmPeak when initializing OpenCL platofrm using clGetPlatformIDs on iMX8

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

High VmPeak when initializing OpenCL platofrm using clGetPlatformIDs on iMX8

834 次查看
adeesh_kale_bshg
Contributor II

When initializing platform, just the single call:

 

error = clGetPlatformIDs(1, &platform_id, nullptr);

 

causes a VmPeak for my process of 209 MB!

Of course, the running memory is not high, but the initial peak is causing application to get killed by oom_reaper on startup.

Is this a known issue? Is this something that is to be expected?

标签 (1)
标记 (2)
0 项奖励
回复
3 回复数

811 次查看
adeesh_kale_bshg
Contributor II

Yes this is for the MX8M Nano. Kernel 5.10. I can show a simple example that I ran to test:

 

#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
#include <CL/cl.h>
#include <unistd.h>

int main(int argc, char *argv[])
{
    cl_platform_id pid = NULL;
    cl_int ret = clGetPlatformIDs(1, &pid, NULL);
    while (1)
        sleep(1);
    return 0;
}

 

 

So if I run this code and do a

 

$ cat /proc/<pid>/status

 

Then I get:

Umask: 0022
State: S (sleeping)
Tgid: 274
Ngid: 0
Pid: 274
PPid: 273
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
FDSize: 64
Groups: 0
NStgid: 274
NSpid: 274
NSpgid: 273
NSsid: 0
VmPeak: 197120 kB
VmSize: 131584 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 3972 kB
VmRSS: 3972 kB
RssAnon: 1176 kB
RssFile: 2792 kB
RssShmem: 4 kB
VmData: 10820 kB
VmStk: 132 kB
VmExe: 4 kB
VmLib: 21324 kB
VmPTE: 132 kB
VmSwap: 0 kB
CoreDumping: 0
THP_enabled: 1
Threads: 2
SigQ: 0/498
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000000004
SigCgt: 0000000180000000
CapInh: 0000000000000000
CapPrm: 000001ffffffffff
CapEff: 000001ffffffffff
CapBnd: 000001ffffffffff
CapAmb: 0000000000000000
NoNewPrivs: 0
Seccomp: 0
Seccomp_filters: 0
Speculation_Store_Bypass: not vulnerable
Cpus_allowed: 1
Cpus_allowed_list: 0
Mems_allowed: 1
Mems_allowed_list: 0
voluntary_ctxt_switches: 129
nonvoluntary_ctxt_switches: 239

Notice the Peak memory value

0 项奖励
回复

817 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Please send the complete log file and your test environment, also is this for MX8Mnano?

Regards

0 项奖励
回复

799 次查看
adeesh_kale_bshg
Contributor II

Hello I've replied above by mistake to my own thread instead of your comment. Please check^

0 项奖励
回复