I’m building PyTorch from Source inside a Dockerfile on a PC with an Intel® Xeon(R) W-2245
CPU. Everything works fine, I can import PyTorch smoothly. When running the same Docker image on a PC with a 13th Gen Intel® Core™ i7-1360P CPU
I get
Illegal instruction (core dumped)
when importing torch.
Here an extract of the Dockerfile
# Build PyTorch wheel with extra environmental variables for custom feature switch
RUN git clone --branch v2.1.0 --depth=1 --recursive https://github.com/pytorch/pytorch /tmp/pytorch
WORKDIR /tmp/pytorch
RUN export USE_NCCL=OFF && \
export USE_CUDA=ON && \
export USE_CUDNN=ON && \
export USE_MKLDNN=ON && \
export ATEN_CPU_CAPABILITY=avx2 && \
export CUDA_NVCC_EXECUTABLE=$(which nvcc) && \
export CUDA_HOME="/usr/local/cuda" && \
export USE_QNNPACK=OFF && \
export USE_PYTORCH_QNNPACK=ON && \
export USE_NATIVE_ARCH=ON && \
export USE_DISTRIBUTED=ON && \
export USE_TENSORRT=OFF && \
pip3 install --no-cache-dir -r requirements.txt && \
pip3 install --no-cache-dir scikit-build ninja && \
python3 setup.py bdist_wheel && \
cp dist/*.whl /opt && \
rm -rf /tmp/pytorch
RUN pip3 install --no-cache-dir --verbose /opt/torch*.whl