criu/Documentation/Makefile
Rajneesh Bhardwaj 55a5993bc7 criu/plugin: Support AMD ROCm Checkpoint Restore with KFD
To support Checkpoint Restore with AMDGPUs for ROCm workloads, introduce
a new plugin to assist CRIU with the help of AMD KFD kernel driver. This
initial commit just provides the basic framework to build up further
capabilities. Like CRIU, the amdgpu plugin also uses protobuf to
serialize
and save the amdkfd data which is mostly VRAM contents with some
metadata.
We generate a data file "amdgpu-kfd-<id>.img" during the dump stage. On restore
this file is read and extracted to re-create various types of buffer
objects that belonged to the previously checkpointed process. Upon
restore the mmap page offset within a device file might change so we use
the new hook to update and adjust the mmap offsets for newly created
target process. This is needed for sys_mmap call in pie restorer phase.
Support for queues and events is added in future patches of this series.

With the current implementation (amdgpu_plugin), we support:
     - Only compute workloads such (Non Gfx) are supported
     - GPU visible inside a container
     - AMD GPU Gfx 9 Family
     - Pytorch Benchmarks such as BERT Base

amdgpu plugin dependes on libdrm and libdrm_amdgpu which are typically
installed with libdrm-dev package. We build amdgpu_plugin only when the
dependencies are met on the target system and when user intends to
install the amdgpu plugin and not by default with criu build.

Suggested-by: Felix Kuehling <felix.kuehling@amd.com>
Co-authored-by: David Yat Sin <david.yatsin@amd.com>
Signed-off-by: David Yat Sin <david.yatsin@amd.com>
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
2022-04-28 17:53:52 -07:00

103 lines
2.5 KiB
Makefile

__nmk_dir ?= ../scripts/nmk/scripts/
include $(__nmk_dir)include.mk
include $(__nmk_dir)macro.mk
ifneq ($(USE_ASCIIDOCTOR),)
ASCIIDOC := asciidoctor
XMLTO :=
else
ASCIIDOC := asciidoc
XMLTO := xmlto
endif
FOOTER := footer.txt
SRC1 += crit.txt
ifeq ($(PYTHON),python3)
SRC1 += criu-ns.txt
endif
SRC1 += compel.txt
SRC1 += amdgpu_plugin.txt
SRC8 += criu.txt
SRC := $(SRC1) $(SRC8)
XMLS := $(patsubst %.txt,%.xml,$(SRC))
MAN1S := $(patsubst %.txt,%.1,$(SRC1))
MAN8S := $(patsubst %.txt,%.8,$(SRC8))
MANS := $(MAN1S) $(MAN8S)
MAN1DIR := $(MANDIR)/man1
MAN8DIR := $(MANDIR)/man8
GROFF :=groff
PAPER :=$(shell paperconf 2>/dev/null || echo letter)
GROFF_OPTS := -Tps -t -dpaper=$(PAPER) -P-p$(PAPER) -man -msafer -rC1 -rD1 -rS11
PSS := $(patsubst %,%.ps,$(basename $(MANS)))
PDFS := $(patsubst %,%.pdf,$(basename $(MANS)))
all: check $(MANS)
ps: $(PSS)
pdf: $(PDFS)
.PHONY: all ps pdf check
check:
$(Q) for B in $(ASCIIDOC) $(XMLTO); do \
$$B --version > /dev/null || exit 1; \
done
ifeq ($(CRIU_VERSION),)
include ../Makefile.versions
endif
$(FOOTER): ../Makefile.versions
$(call msg-gen, $@)
$(Q) echo ":doctype: manpage" > $@
$(Q) echo ":man source: criu" >> $@
$(Q) echo ":man version: $(CRIU_VERSION)" >> $@
$(Q) echo ":man manual: CRIU Manual" >> $@
%.1: %.txt $(FOOTER) custom.xsl
$(call msg-gen, $@)
ifneq ($(USE_ASCIIDOCTOR),)
$(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $<
else
$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.1,%.xml,$@) $<
$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.1,%.xml,$@)
endif
%.8: %.txt $(FOOTER) custom.xsl
$(call msg-gen, $@)
ifneq ($(USE_ASCIIDOCTOR),)
$(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $<
else
$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.8,%.xml,$@)
endif
%.ps: %.1
$(call msg-gen, $@)
$(Q) $(GROFF) $(GROFF_OPTS) $^ > $@
%.ps: %.8
$(call msg-gen, $@)
$(Q) $(GROFF) $(GROFF_OPTS) $^ > $@
%.pdf: %.ps
$(call msg-gen, $@)
$(Q) ps2pdf $< $@
clean:
$(call msg-clean, "Documentation")
$(Q) rm -f $(XMLS) $(MANS) $(PSS) $(PDFS) $(FOOTER)
install: check $(MANS)
$(E) " INSTALL " $(MAN8S)
$(Q) mkdir -p $(DESTDIR)$(MAN8DIR)
$(Q) install -m 644 $(MAN8S) $(DESTDIR)$(MAN8DIR)
$(E) " INSTALL " $(MAN1S)
$(Q) mkdir -p $(DESTDIR)$(MAN1DIR)
$(Q) install -m 644 $(MAN1S) $(DESTDIR)$(MAN1DIR)
uninstall:
$(E) " UNINSTALL" $(MAN1S)
$(Q) $(RM) $(addprefix $(DESTDIR)$(MAN1DIR)/,$(MAN1S))
$(E) " UNINSTALL" $(MAN8S)
$(Q) $(RM) $(addprefix $(DESTDIR)$(MAN8DIR)/,$(MAN8S))
.PHONY: clean install uninstall