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
相关产品推荐
相关产品推荐

