Currently we support Ubuntu 22.04 based systems with fresh CMake (see below). You can try use different systems, but be aware that they are not tested. Some known restrictions are:
- GCC version >= 11.0 (needs proper C++17 support).
- Clang version >= 14.0
- Cmake version >= 3.18
# PNM library dependencies
$ sudo apt install ndctl libndctl-dev daxctl libdaxctl-dev numactl clang
# Linux kernel build dependencies
$ sudo apt install fakeroot ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison rsync kmod cpio dpkg-dev ccache
# Pytorch build dependencies
$ sudo apt install python3-pip libopenblas-dev
# DRAMSim3 and performance simulator build dependencies
$ sudo apt install libglib2.0-dev libpixman-1-dev scons libboost-regex-dev libboost-program-options-dev
# (Optional) Gramine dependencies
$ sudo apt install autoconf bison gawk nasm python3-click python3-jinja2 python3-pyelftools libprotobuf-c-dev protobuf-c-compiler
# Pytorch python dependencies
$ pip3 install -U protobuf==3.13 future yappi numpy==1.23.5 pydot typing_extensions ninja onnx scikit-learn tqdm tensorboard sympy filelock jinja2 networkx
# (Optional) Gramine python dependencies
$ pip3 install -U "meson>=0.56" "toml>=0.10" cryptography Markupsafe==1.1.0
# Install cmake from snap
$ sudo snap install cmake --classic
# or from source code
$ mkdir cmake_src; cd cmake_src; wget https://github.com/Kitware/CMake/releases/download/v3.27.5/cmake-3.27.5.tar.gz
$ tar -zxvf cmake-3.27.5.tar.gz
$ cd cmake-3.27.5; sudo ./bootstrap; sudo make; sudo make install
This command will download OSS projects and apply PNM patches making them ready for build.
$ RELEASE_DIR=`pwd`
$ ./setup_repos.sh $RELEASE_DIR
These commands will build and install PNM-enabled software (kernel and userspace programs).
$ ./build_kernel.sh $RELEASE_DIR
...
$ sudo systemctl reboot
...
$ ./build_userspace.sh $RELEASE_DIR
$ ./build_gramine.sh $RELEASE_DIR
$ export PATH=$RELEASE_DIR/PNMLibrary/build/tools/:$PATH
$ ./setup_sls_func_sim.sh -i
$ EMB_TABLES_DIR=$RELEASE_DIR/emb_tables/; mkdir -p $EMB_TABLES_DIR
$ cd $RELEASE_DIR/PNMLibrary
$ ./scripts/create_test_dataset.sh --dlrm --root $EMB_TABLES_DIR
# Run facebookresearch DLRM
$ cd $RELEASE_DIR/upstream/dlrm
$ ./run_test.sh --weights-path $EMB_TABLES_DIR/DLRM_FLOAT/embedding.bin --use-pnm simple # use 'secure' for SecNDP
# Run DeepRecSys
$ cd $RELEASE_DIR/upstream/DeepRecSys
$ ./run_DeepRecSys_pnm.sh --tables $EMB_TABLES_DIR/DLRM_FLOAT/embedding.bin --use_pnm --num_engines 5
$ ./setup_sls_func_sim.sh -u
$ ./setup_imdb_func_sim.sh -i
$ IMDB_DATA_DIR=$RELEASE_DIR/imdb_data/; mkdir -p $IMDB_DATA_DIR
$ cd $RELEASE_DIR/PNMLibrary
$ ./build/test/imdb_demo $IMDB_DATA_DIR
$ ./setup_imdb_func_sim.sh -u
$ cd $RELEASE_DIR; ./build_perfsim.sh $RELEASE_DIR
Please refer to performance simulator README.md and README_REAL_APP_MODE.md located in 'DRAMsim3' directory after running setup_repos.sh
.
The PNM software stack uses spdlog as a logging library. To enable additional (e.g. debug) logging,
use SPDLOG_LEVEL
environment variable, e.g.:
$ export SPDLOG_LEVEL=debug
In QEMU, add following line in /etc/default/grub
and regenerate grub config:
$ vim /etc/default/grub
...
GRUB_CMDLINE_LINUX="memmap=32G\\\$4G quiet splash console=ttyS0,115200n8 console=tty1"
$ sudo grub-update
$ sudo shutdown -h now
On host:
$ sudo qemu-system-x86_64 -display none -m 36G -boot d -enable-kvm -smp 16 -drive file=testing-image.img,if=virtio -serial stdio -cpu host,l3-cache=on \
-numa node,cpus=0-7,memdev=mem0,nodeid=0 -object memory-backend-ram,id=mem0,size=4G \
-numa node,cpus=8-15,memdev=mem1,nodeid=1 -object memory-backend-ram,id=mem1,size=32G
In QEMU:
$ cd $RELEASE_DIR/upstream/linux
$ bash ../../zswap_scripts/tests_at_once.sh