惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
V
Visual Studio Blog
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 聂微东
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
大猫的无限游戏
大猫的无限游戏
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
D
Docker
MyScale Blog
MyScale Blog
小众软件
小众软件
云风的 BLOG
云风的 BLOG
美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 【当耐特】

博客园 - yeren2046

把 CodeBuddy 接进 DSH RedCoins,一个免费的类似bluecoins的个人财务管理软件 记录一个栈溢出导致的崩溃问题 一个免费的图片数据标注工具 常用zip命令 git版本导致的"Permission denied (publickey). fatal: Could not read from remote repository." 只显示全部特定进程名的top信息的shell脚本 linux 上用 core 文件定位线上问题 ffmpeg 时基转换 昇腾卡通道号范围 ffmpeg视频截取 英伟达硬解码错误汇总 TensorRT生成INT8校准文件 结构体指定初始化 ffmpeg命令行基于英伟达显卡编解码的转码 C++11 获取当前时间戳 基于CUDA查询显卡型号和显存大小 nvjpeg 简单使用 AV_PIX_FMT_CUDA 数据转 RGB C++ do{ } while(0)
DVPP问题汇总
yeren2046 · 2024-09-05 · via 博客园 - yeren2046

1. aclrtSetDevice 使用不当导致内存泄露问题

对于Atlas 推理系列产品(Ascend 310P处理器),调用本接口会隐式创建默认Context,在标准形态下,该默认Context中包含2个Stream,1个默认Stream和1个执行内部同步的Stream。

参考网页:API参考-aclrtSetDevice

aclrtSetDevice

此接口需与aclrtResetDevice接口配套使用,以避免出现泄露。

实际使用中更建议用 Context,Context使用起来更灵活方便。

2.  acldvppChannelDesc 释放方式不当导致内存泄露问题

实际测试中发现,acldvppChannelDesc 的释放需要先切换到对应的设备,如以下:

void VpcUtils::release() {
    
    if(context_){
        aclrtSetCurrentContext(context_);
    
        if (dvppChannelDesc_) {
            (void)acldvppDestroyChannel(dvppChannelDesc_);
            (void)acldvppDestroyChannelDesc(dvppChannelDesc_);
            dvppChannelDesc_ = nullptr;
        }

        aclrtDestroyContext(context_);
    }
}

需要先做   aclrtSetCurrentContext(context_);  操作,否则会有内存泄露。