
我正在尝试构建一个Dockerfile,它是:
FROM pytorch/pytorch:1.1.0-cuda10.0-cudnn7.5-devel
# Dependencies for Pymesh
RUN apt update -qq && apt install -q -y \
libsm6 \
libxext6 \
libxrender-dev \
wget
# Cmake 3.15 (Pymesh dependency)
RUN apt update && \
apt install -y libncurses5-dev libncursesw5-dev libssl1.0.0 libssl-dev && \
cd /workspace && \
wget https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz && \
tar -xf cmake-3.15.2.tar.gz && \
cd cmake-3.15.2/ && \
./bootstrap && \
make -j && \
make install && \
cd ..
# Pymesh
RUN apt update && \
apt install -y libgmp-dev libmpfr-dev libboost-dev libboost-thread-dev && \
cd /workspace && \
git clone https://github.com/PyMesh/PyMesh.git && \
cd PyMesh && \
git submodule update --init && \
./setup.py build && \
./setup.py install
RUN conda install torchvision==0.3 -c pytorch
# Softras
RUN cd /workspace && \
git clone https://github.com/ShichenLiu/SoftRas.git && \
cd SoftRas && \
python setup.py install
# NMR
## for CUDA9, `pip install neural_renderer_pytorch`
## for CUDA 10, install from source as follows
RUN pip install cupy-cuda100 && \
cd /workspace && \
git clone https://github.com/daniilidis-group/neural_renderer/ && \
cd neural_renderer && \
python setup.py build && \
python setup.py install
# Python dependencies
RUN pip install absl-py tensorflow==2.0.0 tensorboard==2.0.1 tensorboardx==1.9 \
opencv-python==4.1.0.25 dotmap scipy visdom dominate meshzoo==0.4.3 moviepy==1.0.1 chainer ipdb
RUN apt update -qq \
&& apt install -qy libglib2.0-0 \
&& apt install -y openssh-server当我指示docker构建它时,它在Building CXX Object Source/CMakeFiles/CMakeLib.dir/...上连续四次冻结,然后出现错误:
[1414.141391] Out of memory: Killed process 16679 (cc1plus) total-vm:86116kB, anon-rss:11628kB, file-rss:0kb, shmem-rss:0kb, UID:0 pgtables:192kb oom_score_adj:0
因此,由于这看起来像是RAM问题,我将VirtualBox的内存调高到了14 to (我在实际的机器上有16 to的RAM ),但每次都会在那里发生错误。
是不是我的主机上没有足够的RAM来破坏它?或者,为什么会发生这种情况还有其他原因吗?
发布于 2020-12-25 01:49:04
问题是Dockerfile中有下面这一行:
`make -j && \`这使得太多的东西同时运行,并占用了内存。将其更改为
`make -j4 && \`解决了问题!
https://stackoverflow.com/questions/65414129
复制相似问题