mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
criu/plugin: Add unit tests for GPU remapping
Adding unit tests for GPU remapping code when checkpointing and restoring on different nodes with different topologies. Signed-off-by: David Yat Sin <david.yatsin@amd.com>
This commit is contained in:
parent
4856e0d4d0
commit
ba9c62df24
3 changed files with 1152 additions and 9 deletions
|
|
@ -5,7 +5,7 @@ PLUGIN_INC := ../../../criu/include
|
|||
PLUGIN_INC_EXTRA := ../../criu/include
|
||||
PLUGIN_INCLUDE := -iquote$(PLUGIN_INC) -iquote$(PLUGIN_INC_EXTRA)
|
||||
LIBDRM_INC := -I/usr/include/libdrm
|
||||
DEPS_OK := amdgpu_plugin.so
|
||||
DEPS_OK := amdgpu_plugin.so amdgpu_plugin_test
|
||||
DEPS_NOK := ;
|
||||
|
||||
include $(__nmk_dir)msg.mk
|
||||
|
|
@ -29,7 +29,18 @@ amdgpu_plugin_clean:
|
|||
$(call msg-clean, $@)
|
||||
$(Q) $(RM) amdgpu_plugin.so criu-amdgpu.pb-c*
|
||||
.PHONY: amdgpu_plugin_clean
|
||||
clean: amdgpu_plugin_clean
|
||||
|
||||
test_topology_remap: amdgpu_plugin_topology.c tests/test_topology_remap.c
|
||||
$(CC) $^ -o $@ -DCOMPILE_TESTS $(PLUGIN_INCLUDE) -I .
|
||||
|
||||
amdgpu_plugin_test: test_topology_remap
|
||||
.PHONY: amdgpu_plugin_test
|
||||
|
||||
amdgpu_plugin_test_clean:
|
||||
$(Q) $(RM) test_topology_remap
|
||||
.PHONY: amdgpu_plugin_test_clean
|
||||
|
||||
clean: amdgpu_plugin_clean amdgpu_plugin_test_clean
|
||||
|
||||
mrproper: clean
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,19 @@
|
|||
#define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_TESTS
|
||||
#undef pr_err
|
||||
#define pr_err(format, arg...) fprintf(stdout, "%s:%d ERROR:" format, __FILE__, __LINE__, ##arg)
|
||||
#undef pr_info
|
||||
#define pr_info(format, arg...) fprintf(stdout, "%s:%d INFO:" format, __FILE__, __LINE__, ##arg)
|
||||
#undef pr_debug
|
||||
#define pr_debug(format, arg...) fprintf(stdout, "%s:%d DBG:" format, __FILE__, __LINE__, ##arg)
|
||||
|
||||
#undef pr_perror
|
||||
#define pr_perror(format, arg...) \
|
||||
fprintf(stdout, "%s:%d: " format " (errno = %d (%s))\n", __FILE__, __LINE__, ##arg, errno, strerror(errno))
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#define plugin_log_msg(fmt, ...) pr_debug(fmt, ##__VA_ARGS__)
|
||||
#else
|
||||
|
|
@ -34,19 +47,19 @@
|
|||
|
||||
/* User override options */
|
||||
/* Skip firmware version check */
|
||||
bool kfd_fw_version_check;
|
||||
bool kfd_fw_version_check = true;
|
||||
/* Skip SDMA firmware version check */
|
||||
bool kfd_sdma_fw_version_check;
|
||||
bool kfd_sdma_fw_version_check = true;
|
||||
/* Skip caches count check */
|
||||
bool kfd_caches_count_check;
|
||||
bool kfd_caches_count_check = true;
|
||||
/* Skip num gws check */
|
||||
bool kfd_num_gws_check;
|
||||
bool kfd_num_gws_check = true;
|
||||
/* Skip vram size check */
|
||||
bool kfd_vram_size_check;
|
||||
bool kfd_vram_size_check = true;
|
||||
/* Preserve NUMA regions */
|
||||
bool kfd_numa_check;
|
||||
bool kfd_numa_check = true;
|
||||
/* Skip capability check */
|
||||
bool kfd_capability_check;
|
||||
bool kfd_capability_check = true;
|
||||
|
||||
static int open_drm_render_device(int minor)
|
||||
{
|
||||
|
|
|
|||
1119
plugins/amdgpu/tests/test_topology_remap.c
Normal file
1119
plugins/amdgpu/tests/test_topology_remap.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue