You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04容器中OpenBLAS线程创建失败(Operation not permitted)排查

基于ubuntu:22.04的容器中OpenBLAS线程创建失败问题

为什么基于FROM ubuntu:22.04构建的容器会出现OpenBLAS blas_thread_init: pthread_create failed for thread 1 of 2: Operation not permitted错误,而该错误在其他容器或宿主机中并未出现?

已排查项

  • 执行ulimit -a | grep max user processes,结果为max user processes (-u) 31136
  • 执行cat /sys/fs/cgroup/pids/pids.max,提示cat: /sys/fs/cgroup/pids/pids.max: No such file or directory
  • 执行docker inspect image_name | grep PidsLimit,结果为 "PidsLimit": 0,
  • 运行容器时添加--env OPENBLAS_NUM_THREADS=2参数,无行为变化
  • 运行容器时添加--env OPENBLAS_NUM_THREADS=1参数,容器可运行,但后续因代码需要2线程报错
  • 对比可正常运行的其他容器,其numpy版本为1.23.5,但并非问题根源

下一步将尝试生成最小复现案例并分享

编辑补充:暂未明确原因,但使用docker run --privileged参数运行容器后,可正常使用全部线程

内容的提问来源于stack exchange,提问作者WurmD

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 02:27:35