当我在一台功能强大的机器上设置ulimit -v
时,我正在研究(48×Intel(R)Xeon(R)CPU E7-4860 v2 @ 2.60GHz,2 TB RAM,红帽企业Linux服务器发布6.7),当我在virtualenv中工作时,python无法导入numpy
,如下所示。当我没有限制资源或者我没有在virtualenv中工作时,一切似乎都很好。
我想这是某个地方的错误。我错误地设置了什么?报告此内容的正确位置在哪里? NumPy的? OpenBLAS?系统管理员?
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 8271875
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 48000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8388604
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
$ python3.5 -c "import numpy" # success
$ ulimit -v 10000000
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 8271875
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 48000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8388604
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) 10000000
file locks (-x) unlimited
$ python3.5 -c "import numpy" # success
$ . ~/venv/stable-3.5/bin/activate
$ python3.5 -c "import numpy"
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 1024 current, 8271875 max
[SNIP: previous two lines shown 46 times]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/users/gholl/venv/stable-3.5/lib/python3.5/site-packages/numpy/__init__.py", line 180, in <module>
from . import add_newdocs
File "/home/users/gholl/venv/stable-3.5/lib/python3.5/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/home/users/gholl/venv/stable-3.5/lib/python3.5/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/home/users/gholl/venv/stable-3.5/lib/python3.5/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/home/users/gholl/venv/stable-3.5/lib/python3.5/site-packages/numpy/core/__init__.py", line 14, in <module>
from . import multiarray
SystemError: initialization of multiarray raised unreported exception
Segmentation fault (core dumped)