helper function
v2 cover helper function
Introduce helper functions for object creation, binding, submission, and destruction, applicable for SVM and other tests
xe-basic test is validating the helper function introduced in 'lib/xe/xe_util: helper function'
svm test cases:
svm-basic-malloc
svm-basic-mmap
svm-random-access
svm-huge-page
svm-atomic-access
svm-atomic-accesssvm_invalid_va
svm-mprotect
svm-benchmark
svm-sparse-access
svm kernel implimentation:
https://gitlab.freedesktop.org/oak/xe-kernel-driver-svm.git
branch: origin/drm-xe-next-svm-unify-userptr
Bommu Krishnaiah (10):
lib/xe/xe_util: Introduce helper functions for buffer creation and
command submission etc
tests/intel/xe_svm: basic xe_svm test
tests/xe_svm: basic svm test
tests/intel/xe_svm: svm_random_access tests/intel/xe_svm: svm-huge-page
tests/intel/xe_svm: svm_atomic_access tests/intel/xe_svm: svm-invalid-va
tests/intel/xe_svm: svm_benchmark
tests/intel/xe_svm: svm_mprotect
tests/intel/xe_svm: svm-sparse-access
include/drm-uapi/xe_drm.h | 2 + lib/xe/xe_util.c | 186 +++++++++++++++++ lib/xe/xe_util.h | 40 ++++ tests/intel/xe_svm.c | 427 ++++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 5 files changed, 656 insertions(+) create mode 100644 tests/intel/xe_svm.c
Signature · 1 line
2.25.1
PATCH v2 1/10 lib/xe/xe_util: Introduce helper functions for buffer creation and command submission etc
Introduce helper functions for buffer creation, binding, command submission, and destruction, applicable for SVM and other tests.
--- lib/xe/xe_util.c | 125 +++++++++++++++++++++++++++++++++++++++++++++++ lib/xe/xe_util.h | 33 +++++++++++++ 2 files changed, 158 insertions(+)
lib/xe/xe_util.c +125 -0
@@ -10,6 +10,131 @@#include "xe/xe_ioctl.h" #include "xe/xe_query.h" #include "xe/xe_util.h" +#include "lib/svga/vm_basic_types.h" + +/*submit a command +* wait for cmmand to cmplete from gpu +* verify ufence value +*/ +int64_t __xe_submit_cmd (struct xe_buffer *cmdbuf) +{ +int64_t timeout =ONE_SEC ; + +struct drm_xe_sync sync[1 ] = { + { .type =DRM_XE_SYNC_TYPE_USER_FENCE , + .flags =DRM_XE_SYNC_FLAG_SIGNAL , + .timeline_value =USER_FENCE_VALUE , + .addr =xe_cmdbuf_exec_ufence_gpuva (cmdbuf),}, + }; +struct drm_xe_exec exec = { + .num_batch_buffer =1 , + .num_syncs =1 , + .syncs =to_user_pointer (&sync), + .exec_queue_id = cmdbuf->exec_queue, + .address = (uint64_t )cmdbuf->gpu_addr, + }; + +xe_exec (cmdbuf->fd, &exec); +return __xe_wait_ufence (cmdbuf->fd,xe_cmdbuf_exec_ufence_cpuva (cmdbuf),USER_FENCE_VALUE , cmdbuf->exec_queue, &timeout); +} + +void xe_submit_cmd (struct xe_buffer *cmdbuf) +{ +int64_t ret; + + ret =__xe_submit_cmd (cmdbuf); +igt_assert_eq (ret,0 ); +} + +/*create a buffer, map it to cpu and gpu */ +void xe_create_buffer (struct xe_buffer *buffer) +{ +struct drm_xe_sync sync[1 ] = { + { .type =DRM_XE_SYNC_TYPE_USER_FENCE , .flags =DRM_XE_SYNC_FLAG_SIGNAL , + .timeline_value =USER_FENCE_VALUE }, + }; + + buffer->bind_queue =xe_bind_exec_queue_create (buffer->fd, buffer->vm,0 ); + buffer->bind_ufence =aligned_alloc (xe_get_default_alignment (buffer->fd),PAGE_ALIGN_UFENCE ); + sync->addr = (uint64_t )buffer->bind_ufence; + +if (!buffer->is_userptr) { + buffer->bo =xe_bo_create (buffer->fd,0 , buffer->size, buffer->placement, buffer->flag); + buffer->cpu_addr =xe_bo_map (buffer->fd, buffer->bo, buffer->size); +xe_vm_bind_async (buffer->fd, buffer->vm, buffer->bind_queue, buffer->bo,0 , (uint64_t )buffer->gpu_addr, buffer->size, sync,1 ); + }else { + buffer->cpu_addr =aligned_alloc (xe_get_default_alignment (buffer->fd), buffer->size); +xe_vm_bind_userptr_async (buffer->fd, buffer->vm, buffer->bind_queue,to_user_pointer (buffer->cpu_addr), (uint64_t )buffer->gpu_addr, buffer->size, sync,1 ); + } + +xe_wait_ufence (buffer->fd, (uint64_t *)buffer->bind_ufence,USER_FENCE_VALUE , buffer->bind_queue,ONE_SEC ); +} + +/* destroy buffers which is created in xe_create_buffer */ +void xe_destroy_buffer (struct xe_buffer *buffer) +{ +struct drm_xe_sync sync[1 ] = { + { .type =DRM_XE_SYNC_TYPE_USER_FENCE , .flags =DRM_XE_SYNC_FLAG_SIGNAL , + .timeline_value =USER_FENCE_VALUE }, + }; + sync->addr = (uint64_t )buffer->bind_ufence; + +xe_vm_unbind_async (buffer->fd, buffer->vm, buffer->bind_queue,0 , (uint64_t )buffer->gpu_addr, buffer->size, sync,1 ); +xe_wait_ufence (buffer->fd, (uint64_t *)buffer->bind_ufence,USER_FENCE_VALUE , buffer->bind_queue,ONE_SEC ); + +munmap (buffer->cpu_addr, buffer->size); +if (!buffer->is_userptr) +gem_close (buffer->fd, buffer->bo); +else +free (buffer->cpu_addr); + +free (buffer->bind_ufence); +xe_exec_queue_destroy (buffer->fd, buffer->bind_queue); +} + +/* +a command buffer is a buffer in GT0's vram, filled with gpu commands, +plus some memory for a ufence used to sync command submission +*/ +void insert_store (uint32_t *batch,uint64_t dst_va,uint32_t val) +{ +int i =0 ; + + batch[i] =MI_STORE_DWORD_IMM_GEN4 ; + batch[++i] = dst_va; + batch[++i] = dst_va >>32 ; + batch[++i] = val; + batch[++i] =MI_BATCH_BUFFER_END ; +} + +void xe_create_cmdbuf (struct xe_buffer *cmd_buf,cmdbuf_fill_func_t fill_func,uint64_t dst_va,uint32_t val,struct drm_xe_engine_class_instance *eci) +{ +//make some room for a exec_ufence, which will be used to sync the +//submission of this command.... + + cmd_buf->size =xe_bb_size (cmd_buf->fd, cmd_buf->size +PAGE_ALIGN_UFENCE ); +xe_create_buffer (cmd_buf); + cmd_buf->exec_queue =xe_exec_queue_create (cmd_buf->fd, cmd_buf->vm, eci,0 ); +fill_func (cmd_buf->cpu_addr, dst_va, val); +} + +void xe_destroy_cmdbuf (struct xe_buffer *cmd_buf) +{ +xe_exec_queue_destroy (cmd_buf->fd, cmd_buf->exec_queue); +xe_destroy_buffer (cmd_buf); +} + +uint64_t xe_cmdbuf_exec_ufence_gpuva (struct xe_buffer *cmd_buf) +{ +/* the last 8 bytes of the cmd buffer is used as ufence */ +return (uint64_t )cmd_buf->gpu_addr + cmd_buf->size -8 ; +} + +uint64_t *xe_cmdbuf_exec_ufence_cpuva (struct xe_buffer *cmd_buf) +{ +/* the last 8 bytes of the cmd buffer is used as ufence */ +return cmd_buf->cpu_addr + cmd_buf->size -8 ; +} static bool __region_belongs_to_regions_type(struct drm_xe_mem_region *region, uint32_t *mem_regions_type,
lib/xe/xe_util.h +33 -0
@@ -12,6 +12,39 @@#include <stdint.h> #include <xe_drm.h> +#define USER_FENCE_VALUE 0xdeadbeefdeadbeefull +#define ONE_SEC MS_TO_NS(1000) +#define PAGE_ALIGN_UFENCE 4096 + +struct xe_buffer { +void *cpu_addr; +void *gpu_addr; +/*the user fence used to vm bind this buffer*/ +uint32_t *bind_ufence; +uint64_t size; +uint32_t flag; +uint32_t vm; +uint32_t bo; +uint32_t placement; +uint32_t bind_queue; +/*only a cmd buffer has a exec queue*/ +uint32_t exec_queue; +int fd; +bool is_userptr; +}; + +typedef void (*cmdbuf_fill_func_t ) (uint32_t *batch,uint64_t dst_gpu_va,uint32_t val); +void xe_create_buffer (struct xe_buffer *buffer); +void xe_create_cmdbuf (struct xe_buffer *cmd_buf,cmdbuf_fill_func_t fill_func, +uint64_t dst_va,uint32_t val,struct drm_xe_engine_class_instance *eci); +uint64_t xe_cmdbuf_exec_ufence_gpuva (struct xe_buffer *cmd_buf); +uint64_t *xe_cmdbuf_exec_ufence_cpuva (struct xe_buffer *cmd_buf); +void insert_store (uint32_t *batch,uint64_t dst_va,uint32_t val); +void xe_submit_cmd (struct xe_buffer *cmdbuf); +int64_t __xe_submit_cmd (struct xe_buffer *cmdbuf); +void xe_destroy_buffer (struct xe_buffer *buffer); +void xe_destroy_cmdbuf (struct xe_buffer *cmd_buf); +#define XE_IS_SYSMEM_MEMORY_REGION (fd, region) \ (xe_region_class(fd, region) == DRM_XE_MEM_REGION_CLASS_SYSMEM)#define XE_IS_VRAM_MEMORY_REGION (fd, region) \
Signature · 1 line
2.25.1
PATCH v2 2/10 tests/intel/xe_svm: basic xe_svm test
In reply to Bommu KrishnaiahAdd basic test to validate helper functions introduced in 'lib/xe/xe_util: helper function'. This test writes values to the destination buffer using GPU (MI_STORE_DWORD_IMM_GEN4).
--- tests/intel/xe_svm.c | 92 ++++++++++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 2 files changed, 93 insertions(+) create mode 100644 tests/intel/xe_svm.c
tests/intel/xe_svm.c new file +92 -0
@@ -0,0 +1,92 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2024 Intel Corporation +*/ + +/** @file xe_svm.c +* +* Test shared virtual memory. +* +* Shared virtual memory (svm in short) is a xe driver feature +* which provide shared virtual address space b/t CPU and GPU +* program. This means application writer can just malloc or mmap, +* and use the returned ptr for both CPU and GPU program. +*/ + +/** +* TEST: xe_basic +* Description: Basic test to verify store dword by using helper funtions +*/ + +#include <fcntl.h> +#include <string.h> + +#include "igt.h" +#include "lib/igt_syncobj.h" +#include "lib/intel_reg.h" +#include "lib/xe/xe_util.h" +#include "xe_drm.h" + +#include "xe/xe_ioctl.h" +#include "xe/xe_query.h" + +/** +* Verifies xe basic work load on gpu +*/ +static void xe_basic (int fd,uint32_t vm,struct drm_xe_engine_class_instance *eci) +{ +uint64_t gpu_va =0x1a0000 ; +uint32_t val =0xc0ffee ; +size_t bo_size =xe_bb_size (fd,PAGE_ALIGN_UFENCE ); + +struct xe_buffer dst_buf = { + .fd = fd, + .gpu_addr = (void *)(uintptr_t )gpu_va, + .vm = vm, + .size = bo_size, + .placement =vram_if_possible (fd, eci->gt_id), + .flag =DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM , + }; + +struct xe_buffer cmd_buf = { + .fd = fd, + .gpu_addr = (void *)(uintptr_t )gpu_va + bo_size, + .vm = vm, + .size = bo_size, + .placement =vram_if_possible (fd, eci->gt_id), + .flag =DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM , + }; + +xe_create_buffer (&dst_buf); +xe_create_cmdbuf (&cmd_buf, insert_store, (uint64_t )dst_buf.gpu_addr, val, eci); +xe_submit_cmd (&cmd_buf); + +igt_assert_eq (*(uint32_t *)dst_buf.cpu_addr, val); + +xe_destroy_cmdbuf (&cmd_buf); +xe_destroy_buffer (&dst_buf); +} + +igt_main +{ +int fd; +uint32_t vm; +struct drm_xe_engine_class_instance *hwe; + + igt_fixture { + fd =drm_open_driver (DRIVER_XE ); +igt_require (xe_supports_faults (fd)); + vm =xe_vm_create (fd,DRM_XE_VM_CREATE_FLAG_LR_MODE |DRM_XE_VM_CREATE_FLAG_FAULT_MODE ,0 ); + } + + + igt_subtest_f("xe-basic") +xe_for_each_engine (fd, hwe) +xe_basic (fd, vm, hwe); + + igt_fixture { +xe_vm_destroy (fd, vm); +drm_close_driver (fd); + } +} +
tests/meson.build +1 -0
@@ -314,6 +314,7 @@ intel_xe_progs = [ 'xe_vm', 'xe_waitfence', 'xe_spin_batch', + 'xe_svm', 'xe_sysfs_defaults', 'xe_sysfs_scheduler', ]
Signature · 1 line
2.25.1
PATCH v2 3/10 tests/xe_svm: basic svm test
In reply to Bommu KrishnaiahTest will verify SVM basic functionality, by allocating a memory with system allocator(malloc() or mmap()) and accessing in GPU.
--- include/drm-uapi/xe_drm.h | 2 ++ tests/intel/xe_svm.c | 57 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 2 deletions(-)
include/drm-uapi/xe_drm.h +2 -0
@@ -973,6 +973,8 @@ struct drm_xe_vm_bind_op {#define DRM_XE_VM_BIND_FLAG_IMMEDIATE (1 << 1)#define DRM_XE_VM_BIND_FLAG_NULL (1 << 2)#define DRM_XE_VM_BIND_FLAG_DUMPABLE (1 << 3) +#define DRM_XE_VM_BIND_FLAG_SYSTEM_ALLOCATOR (1 << 4) +/** @flags: Bind flags */ __u32 flags;
tests/intel/xe_svm.c +55 -2
82 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH i-g-t v2 03/10] tests/xe_svm: basic svm test
Hi Bommu,
On 2024-05-14 at 12:40:19 +0530, Bommu Krishnaiah wrote:
please imprve subject:
[PATCH i-g-t v2 03/10] tests/xe_svm: basic svm test
imho better:
[PATCH i-g-t v2 03/10] tests/intel/xe_svm: add basic svm test
Quoted 2 lines
Test will verify SVM basic functionality, by allocating a memory with system allocator(malloc() or
mmap()) and accessing in GPU.
Please describe it more here, how you will verify it.
imho basic test could just access it using pointer from malloc.
Quoted 27 lines
Signed-off-by Bommu Krishnaiah <[email protected]>Cc Oak Zeng <[email protected]>Cc Himal Prasad Ghimiray <[email protected]>--- include/drm-uapi/xe_drm.h | 2 ++ tests/intel/xe_svm.c | 57 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 2 deletions(-)include/drm-uapi/xe_drm.h +2
-0@@ -973,6 +973,8 @@ struct drm_xe_vm_bind_op {#define DRM_XE_VM_BIND_FLAG_IMMEDIATE (1 << 1)#define DRM_XE_VM_BIND_FLAG_NULL (1 << 2)#define DRM_XE_VM_BIND_FLAG_DUMPABLE (1 << 3) +#define DRM_XE_VM_BIND_FLAG_SYSTEM_ALLOCATOR (1 << 4) +/** @flags: Bind flags */ __u32 flags;tests/intel/xe_svm.c +0
-0
tests/intel/xe_svm.c line 17
Quoted 5 lines
tests/intel/xe_svm.c +1
-1@@ -14,8 +14,18 @@*/ /** -* TEST: xe_basic +* TEST: xe_svm
Do not do this, make this correct from beginning in previous patch.
tests/intel/xe_svm.c line 21
Quoted 4 lines
tests/intel/xe_svm.c +4
-0+* Description: Test shared virtual memory +* Sub-category: Memory management +* Functionality: svm +* Run type: FULL
Add also Mega feature:
tests/intel/xe_svm.c line 23
Quoted 2 lines
tests/intel/xe_svm.c +2
-0+* +* SUBTEST: xe_basic
-------------- ^^^
imho this would be svm-basic-gpu-access
tests/intel/xe_svm.c line 24
Quoted 1 line
tests/intel/xe_svm.c +0
-0* Description: Basic test to verify store dword by using helper funtions
Add newline.
tests/intel/xe_svm.c line 26
Quoted 2 lines
tests/intel/xe_svm.c +2
-0+* SUBTEST: svm-basic-malloc +* Description: verify SVM basic functionality by using malloc
Add newline.
Quoted 47 lines
tests/intel/xe_svm.c +36
-0+* SUBTEST: svm-basic-mmap +* Description: verify SVM basic functionality by using mmap */ #include <fcntl.h> @@ -67,6 +77,40 @@ static void xe_basic(int fd, uint32_t vm, struct drm_xe_engine_class_instance *exe_destroy_buffer (&dst_buf); } +/** +* Use malloc or mmap memory for direct GPU submission +*/ +static void svm_basic (int fd,uint32_t vm,struct drm_xe_engine_class_instance *eci,bool test_mmap) +{ +uint64_t gpu_va =0x1a0000 ; +size_t bo_size =xe_bb_size (fd,PAGE_ALIGN_UFENCE ); +uint32_t *dst; + +struct xe_buffer cmd_buf = { + .fd = fd, + .gpu_addr = (void *)(uintptr_t )gpu_va, + .vm = vm, + .size = bo_size, + .placement =vram_if_possible (fd, eci->gt_id), + .flag =DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM , + }; + +if (test_mmap) + dst =mmap (NULL ,4 ,PROT_READ |PROT_WRITE ,MAP_PRIVATE |MAP_ANONYMOUS ,-1 ,0 ); +else + dst =aligned_alloc (xe_get_default_alignment (fd),4 ); + +xe_create_cmdbuf (&cmd_buf, insert_store, (uint64_t )dst,0xc0ffee , eci); +xe_submit_cmd (&cmd_buf); +igt_assert_eq (*dst,0xc0ffee ); +xe_destroy_cmdbuf (&cmd_buf); + +if (test_mmap) +munmap (dst,4 ); +else +free (dst); +} + igt_main {int fd;
tests/intel/xe_svm.c igt_main · line 82
Quoted 8 lines
tests/intel/xe_svm.c +2
-1@@ -77,13 +121,22 @@ igt_main fd =drm_open_driver (DRIVER_XE );igt_require (xe_supports_faults (fd)); vm =xe_vm_create (fd,DRM_XE_VM_CREATE_FLAG_LR_MODE |DRM_XE_VM_CREATE_FLAG_FAULT_MODE ,0 ); +__xe_vm_bind_assert (fd, vm,0 ,0 ,0 ,0 ,0x1ull <<47 ,DRM_XE_VM_BIND_OP_MAP , +DRM_XE_VM_BIND_FLAG_SYSTEM_ALLOCATOR ,0 ,0 ,0 ,0 ); } -
Remove this in previous patch.
Regards,
Kamil
Quoted 18 lines
tests/intel/xe_svm.c +8
-0igt_subtest_f("xe-basic")xe_for_each_engine (fd, hwe)xe_basic (fd, vm, hwe); + igt_subtest_f("svm-basic-malloc") +xe_for_each_engine (fd, hwe) +svm_basic (fd, vm, hwe, false); + + igt_subtest_f("svm-basic-mmap") +xe_for_each_engine (fd, hwe) +svm_basic (fd, vm, hwe, true); + igt_fixture {xe_vm_destroy (fd, vm);drm_close_driver (fd);Signature · 1 line
2.25.1
PATCH v2 4/10 tests/intel/xe_svm: svm_random_access
In reply to Bommu KrishnaiahVerify GPU can randomly access any location in malloc'ed memory by using svm.
--- tests/intel/xe_svm.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
tests/intel/xe_svm.c +38 -0
@@ -26,6 +26,9 @@* Description: verify SVM basic functionality by using malloc * SUBTEST: svm-basic-mmap * Description: verify SVM basic functionality by using mmap +* SUBTEST: svm-random-access +* Description: verify SVM basic functionality by using +* randomly access any location in malloc'ed memory */ #include <fcntl.h>
@@ -111,6 +114,37 @@ static void svm_basic(int fd, uint32_t vm, struct drm_xe_engine_class_instance *free (dst); } +/** +* Verify GPU can randomly access any location in malloc'ed memory +*/ +static void svm_random_access (int fd,uint32_t vm,struct drm_xe_engine_class_instance *eci) +{ +uint64_t gpu_va =0x1a0000 ; +size_t bo_size =xe_bb_size (fd,PAGE_ALIGN_UFENCE ); +uint32_t *dst, *dst_to_access; +uint32_t size =1024 *1024 , sz_dw = size/4 ; + +struct xe_buffer cmd_buf = { + .fd = fd, + .gpu_addr = (void *)(uintptr_t )gpu_va, + .vm = vm, + .size = bo_size, + .placement =vram_if_possible (fd, eci->gt_id), + .flag =DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM , + }; + + dst =malloc (size); + dst_to_access = dst +random ()%sz_dw; + +xe_create_cmdbuf (&cmd_buf, insert_store, (uint64_t )dst_to_access,0xc0ffee , eci); +xe_submit_cmd (&cmd_buf); + +igt_assert_eq (*dst,0xc0ffee ); + +xe_destroy_cmdbuf (&cmd_buf); +free (dst); +} + igt_main {int fd;
@@ -137,6 +171,10 @@ igt_mainxe_for_each_engine (fd, hwe)svm_basic (fd, vm, hwe, true); + igt_subtest_f("svm-random-access") +xe_for_each_engine (fd, hwe) +svm_random_access (fd, vm, hwe); + igt_fixture {xe_vm_destroy (fd, vm);drm_close_driver (fd);
Signature · 1 line
2.25.1
PATCH v2 5/10 tests/intel/xe_svm: svm-huge-page
In reply to Bommu KrishnaiahVerify GPU can huge page access by using svm.
--- tests/intel/xe_svm.c | 52 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-)
tests/intel/xe_svm.c +50 -2
@@ -27,8 +27,9 @@* SUBTEST: svm-basic-mmap * Description: verify SVM basic functionality by using mmap * SUBTEST: svm-random-access -* Description: verify SVM basic functionality by using -* randomly access any location in malloc'ed memory +* Description: verify SVM basic functionality by using randomly access any location in malloc'ed memory +* SUBTEST: svm-huge-page +* Description: verify SVM basic functionality by using huge page access */ #include <fcntl.h>
@@ -145,6 +146,49 @@ static void svm_random_access(int fd, uint32_t vm, struct drm_xe_engine_class_infree (dst); } +/** +* Test the behavior of transparent huge page. +* Allocate 2MB of aligned memory so huge page +* is used. What happens if driver only migrate +* 1 4k page of that buffer to GPU? +* +* Test result shows that the huge page is splitted +* into small pages and only one 4k page is +* migrated. +*/ +static void svm_thp (int fd,uint32_t vm,struct drm_xe_engine_class_instance *eci) +{ +uint64_t gpu_va =0x1a0000 ; +size_t bo_size =xe_bb_size (fd,PAGE_ALIGN_UFENCE ); +uint32_t size =1 <<21 ; +uint32_t *dst; +int ret; + +struct xe_buffer cmd_buf = { + .fd = fd, + .gpu_addr = (void *)(uintptr_t )gpu_va, + .vm = vm, + .size = bo_size, + .placement =vram_if_possible (fd, eci->gt_id), + .flag =DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM , + }; + + ret =posix_memalign ((void **)&dst, size, size); +igt_assert_eq (ret,0 ); +/** TODO huge page advice cause the system hang +* when process exit...Very possible a hmm bug +**/ +memset (dst,0xbe , size); + +xe_create_cmdbuf (&cmd_buf, insert_store, (uint64_t )dst,0xc0ffee , eci); +xe_submit_cmd (&cmd_buf); + +igt_assert_eq (*dst,0xc0ffee ); + +xe_destroy_cmdbuf (&cmd_buf); +free (dst); +} + igt_main {int fd;
@@ -175,6 +219,10 @@ igt_mainxe_for_each_engine (fd, hwe)svm_random_access (fd, vm, hwe); + igt_subtest_f("svm-huge-page") +xe_for_each_engine (fd, hwe) +svm_thp (fd, vm, hwe); + igt_fixture {xe_vm_destroy (fd, vm);drm_close_driver (fd);
Signature · 1 line
2.25.1
PATCH v2 6/10 tests/intel/xe_svm: svm_atomic_access
In reply to Bommu KrishnaiahVerify GPU atomic access any location in malloc'ed memory by using svm
--- lib/xe/xe_util.c | 17 +++++++++++++++++ lib/xe/xe_util.h | 1 + tests/intel/xe_svm.c | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+)
lib/xe/xe_util.c +17 -0
@@ -107,6 +107,23 @@ void insert_store(uint32_t *batch, uint64_t dst_va, uint32_t val) batch[++i] =MI_BATCH_BUFFER_END ; } +/* +a command buffer is a buffer in GT0's vram, filled with gpu commands, +plus some memory for a ufence used to sync command submission +*/ +void insert_atomic_inc (uint32_t *batch,uint64_t dst_va,uint32_t val) +{ +int i =0 ; + +//suppress compiler warning + (void )(val); + + batch[i] =MI_STORE_DWORD_IMM_GEN4 ; + batch[++i] = dst_va; + batch[++i] = dst_va >>32 ; + batch[++i] =MI_BATCH_BUFFER_END ; +} +void xe_create_cmdbuf (struct xe_buffer *cmd_buf,cmdbuf_fill_func_t fill_func,uint64_t dst_va,uint32_t val,struct drm_xe_engine_class_instance *eci) {//make some room for a exec_ufence, which will be used to sync the
lib/xe/xe_util.h +1 -0
@@ -40,6 +40,7 @@ void xe_create_cmdbuf(struct xe_buffer *cmd_buf, cmdbuf_fill_func_t fill_func,uint64_t xe_cmdbuf_exec_ufence_gpuva (struct xe_buffer *cmd_buf);uint64_t *xe_cmdbuf_exec_ufence_cpuva (struct xe_buffer *cmd_buf);void insert_store (uint32_t *batch,uint64_t dst_va,uint32_t val); +void insert_atomic_inc (uint32_t *batch,uint64_t dst_va,uint32_t val);void xe_submit_cmd (struct xe_buffer *cmdbuf);int64_t __xe_submit_cmd (struct xe_buffer *cmdbuf);void xe_destroy_buffer (struct xe_buffer *buffer);
tests/intel/xe_svm.c +39 -0
@@ -30,6 +30,8 @@* Description: verify SVM basic functionality by using randomly access any location in malloc'ed memory * SUBTEST: svm-huge-page * Description: verify SVM basic functionality by using huge page access +* SUBTEST: svm-atomic-access +* Description: verify SVM basic functionality by using GPU atomic access any location in malloc'ed memory */ #include <fcntl.h>
@@ -189,6 +191,39 @@ static void svm_thp(int fd, uint32_t vm, struct drm_xe_engine_class_instance *ecfree (dst); } +/** +* Test GPU atomic access any location in malloc'ed memory +*/ +static void svm_atomic_access (int fd,uint32_t vm,struct drm_xe_engine_class_instance *eci) +{ +uint64_t gpu_va =0x1a0000 ; +int val =0xc0ffee ; +size_t bo_size =xe_bb_size (fd,PAGE_ALIGN_UFENCE ); +uint32_t *dst, *dst_to_access; +uint32_t size =1024 *1024 , sz_dw = size/4 ; + +struct xe_buffer cmd_buf = { + .fd = fd, + .gpu_addr = (void *)(uintptr_t )gpu_va, + .vm = vm, + .size = bo_size, + .placement =vram_if_possible (fd, eci->gt_id), + .flag =DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM , + }; + + dst =aligned_alloc (xe_get_default_alignment (fd), size); + dst_to_access = dst +random ()%sz_dw; + *dst_to_access = val; + +xe_create_cmdbuf (&cmd_buf, insert_atomic_inc, (uint64_t )dst_to_access, val, eci); +xe_submit_cmd (&cmd_buf); + +igt_assert_eq (*dst_to_access, val +1 ); + +xe_destroy_cmdbuf (&cmd_buf); +free (dst); +} + igt_main {int fd;
@@ -223,6 +258,10 @@ igt_mainxe_for_each_engine (fd, hwe)svm_thp (fd, vm, hwe); + igt_subtest_f("svm-atomic-access") +xe_for_each_engine (fd, hwe) +svm_atomic_access (fd, vm, hwe); + igt_fixture {xe_vm_destroy (fd, vm);drm_close_driver (fd);
Signature · 1 line
2.25.1
Re: [PATCH i-g-t v2 06/10] tests/intel/xe_svm: svm_atomic_access
Quoted 1 line · Bommu Krishnaiah
Verify GPU atomic access any location in malloc'ed memory by using svm
Shouldn't we somehow also explicitly ensure, that GPU malloc'ed memory access is indeed atomic?
Current test just checks that GPU actually does the increment. However if that is supposed to be atomic, we probably need to do something like modifying it from multiple threads and then end result, should be then incremented twice or something like that?
Otherwise not clear, what is meant by "atomicity" here.
Stan
Quoted 117 lines
Signed-off-by Bommu Krishnaiah <[email protected]>Cc Oak Zeng <[email protected]>Cc Himal Prasad Ghimiray <[email protected]>--- lib/xe/xe_util.c | 17 +++++++++++++++++ lib/xe/xe_util.h | 1 + tests/intel/xe_svm.c | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+)lib/xe/xe_util.c +17
-0@@ -107,6 +107,23 @@ void insert_store(uint32_t *batch, uint64_t dst_va, uint32_t val) batch[++i] =MI_BATCH_BUFFER_END ; } +/* +a command buffer is a buffer in GT0's vram, filled with gpu commands, +plus some memory for a ufence used to sync command submission +*/ +void insert_atomic_inc (uint32_t *batch,uint64_t dst_va,uint32_t val) +{ +int i =0 ; + +//suppress compiler warning + (void )(val); + + batch[i] =MI_STORE_DWORD_IMM_GEN4 ; + batch[++i] = dst_va; + batch[++i] = dst_va >>32 ; + batch[++i] =MI_BATCH_BUFFER_END ; +} +void xe_create_cmdbuf (struct xe_buffer *cmd_buf,cmdbuf_fill_func_t fill_func,uint64_t dst_va,uint32_t val,struct drm_xe_engine_class_instance *eci) {//make some room for a exec_ufence, which will be used to sync the lib/xe/xe_util.h +1
-0@@ -40,6 +40,7 @@ void xe_create_cmdbuf(struct xe_buffer *cmd_buf, cmdbuf_fill_func_t fill_func,uint64_t xe_cmdbuf_exec_ufence_gpuva (struct xe_buffer *cmd_buf);uint64_t *xe_cmdbuf_exec_ufence_cpuva (struct xe_buffer *cmd_buf);void insert_store (uint32_t *batch,uint64_t dst_va,uint32_t val); +void insert_atomic_inc (uint32_t *batch,uint64_t dst_va,uint32_t val);void xe_submit_cmd (struct xe_buffer *cmdbuf);int64_t __xe_submit_cmd (struct xe_buffer *cmdbuf);void xe_destroy_buffer (struct xe_buffer *buffer);tests/intel/xe_svm.c +39
-0@@ -30,6 +30,8 @@* Description: verify SVM basic functionality by using randomly access any location in malloc'ed memory * SUBTEST: svm-huge-page * Description: verify SVM basic functionality by using huge page access +* SUBTEST: svm-atomic-access +* Description: verify SVM basic functionality by using GPU atomic access any location in malloc'ed memory */ #include <fcntl.h> @@ -189,6 +191,39 @@ static void svm_thp(int fd, uint32_t vm, struct drm_xe_engine_class_instance *ecfree (dst); } +/** +* Test GPU atomic access any location in malloc'ed memory +*/ +static void svm_atomic_access (int fd,uint32_t vm,struct drm_xe_engine_class_instance *eci) +{ +uint64_t gpu_va =0x1a0000 ; +int val =0xc0ffee ; +size_t bo_size =xe_bb_size (fd,PAGE_ALIGN_UFENCE ); +uint32_t *dst, *dst_to_access; +uint32_t size =1024 *1024 , sz_dw = size/4 ; + +struct xe_buffer cmd_buf = { + .fd = fd, + .gpu_addr = (void *)(uintptr_t )gpu_va, + .vm = vm, + .size = bo_size, + .placement =vram_if_possible (fd, eci->gt_id), + .flag =DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM , + }; + + dst =aligned_alloc (xe_get_default_alignment (fd), size); + dst_to_access = dst +random ()%sz_dw; + *dst_to_access = val; + +xe_create_cmdbuf (&cmd_buf, insert_atomic_inc, (uint64_t )dst_to_access, val, eci); +xe_submit_cmd (&cmd_buf); + +igt_assert_eq (*dst_to_access, val +1 ); + +xe_destroy_cmdbuf (&cmd_buf); +free (dst); +} + igt_main {int fd;@@ -223,6 +258,10 @@ igt_mainxe_for_each_engine (fd, hwe)svm_thp (fd, vm, hwe); + igt_subtest_f("svm-atomic-access") +xe_for_each_engine (fd, hwe) +svm_atomic_access (fd, vm, hwe); + igt_fixture {xe_vm_destroy (fd, vm);drm_close_driver (fd);Signature · 1 line
2.25.1
PATCH v2 7/10 tests/intel/xe_svm: svm-invalid-va
In reply to Bommu KrishnaiahVerify SVM functionality while accessing invalid address
--- tests/intel/xe_svm.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
tests/intel/xe_svm.c +34 -0
@@ -32,6 +32,8 @@* Description: verify SVM basic functionality by using huge page access * SUBTEST: svm-atomic-access * Description: verify SVM basic functionality by using GPU atomic access any location in malloc'ed memory +* SUBTEST: svm_invalid_va +* Description: verify SVM functionality while accessing invalid address */ #include <fcntl.h>
@@ -224,6 +226,34 @@ static void svm_atomic_access(int fd, uint32_t vm, struct drm_xe_engine_class_infree (dst); } +/** +* Submit a GPU command to access an invalid address. +* Driver should detect a catstrophic error. +*/ +static void svm_invalid_va (int fd,uint32_t vm,struct drm_xe_engine_class_instance *eci) +{ +uint64_t gpu_va =0x1a0000 ; +size_t bo_size =xe_bb_size (fd,PAGE_ALIGN_UFENCE ); +uint32_t *dst; + +struct xe_buffer cmd_buf = { + .fd = fd, + .gpu_addr = (void *)(uintptr_t )gpu_va, + .vm = vm, + .size = bo_size, + .placement =vram_if_possible (fd, eci->gt_id), + .flag =DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM + }; + + dst = (uint32_t *)0x1fffffffffff000 ; + +xe_create_cmdbuf (&cmd_buf, insert_store, (uint64_t )dst,0xc0ffee , eci); +igt_assert_eq (__xe_submit_cmd (&cmd_buf), -EIO );// for invalid address __xe_wait_ufence will return -EIO + +xe_destroy_cmdbuf (&cmd_buf); +free (dst); +} + igt_main {int fd;
@@ -262,6 +292,10 @@ igt_mainxe_for_each_engine (fd, hwe)svm_atomic_access (fd, vm, hwe); + igt_subtest_f("svm-invalid-va") +xe_for_each_engine (fd, hwe) +svm_invalid_va (fd, vm, hwe); + igt_fixture {xe_vm_destroy (fd, vm);drm_close_driver (fd);
Signature · 1 line
2.25.1
PATCH v2 8/10 tests/intel/xe_svm: svm_benchmark
In reply to Bommu KrishnaiahVerify SVM performance with simple benchmark test
--- lib/xe/xe_util.c | 29 ++++++++++++++++++++++++++++ lib/xe/xe_util.h | 5 +++++ tests/intel/xe_svm.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+)
lib/xe/xe_util.c +29 -0
@@ -124,6 +124,24 @@ void insert_atomic_inc(uint32_t *batch, uint64_t dst_va, uint32_t val) batch[++i] =MI_BATCH_BUFFER_END ; } +/** Insert commands to batch buffer to memset dst_va buffer with val +*/ +void insert_memset (uint32_t *batch,uint64_t dst_va,uint64_t size,uint32_t val) +{ +#define PVC_MEM_SET_CMD (2 << 29 | 0x5b << 22) +#define MS_MATRIX (1 << 17) +const int page_shift =12 ; + + *batch++ =PVC_MEM_SET_CMD |MS_MATRIX | (7 -2 ); + *batch++ =BIT (page_shift) -1 ; + *batch++ = (size >> page_shift) -1 ; + *batch++ =BIT (page_shift) -1 ; + *batch++ =lower_32_bits (dst_va); + *batch++ =upper_32_bits (dst_va); + *batch++ = (uint32_t )val <<24 ; + *batch++ =MI_BATCH_BUFFER_END ; +} +void xe_create_cmdbuf (struct xe_buffer *cmd_buf,cmdbuf_fill_func_t fill_func,uint64_t dst_va,uint32_t val,struct drm_xe_engine_class_instance *eci) {//make some room for a exec_ufence, which will be used to sync the
@@ -135,6 +153,17 @@ void xe_create_cmdbuf(struct xe_buffer *cmd_buf, cmdbuf_fill_func_t fill_func, ufill_func (cmd_buf->cpu_addr, dst_va, val); } +void xe_create_cmdbuf_fill_two_dw (struct xe_buffer *cmd_buf,cmdbuf_fill_two_dw_func_t fill_func,uint64_t dst_va,uint64_t dst_va1,uint32_t val,struct drm_xe_engine_class_instance *eci) +{ +//make some room for a exec_ufence, which will be used to sync the +//submission of this command.... + + cmd_buf->size =xe_bb_size (cmd_buf->fd, cmd_buf->size +PAGE_ALIGN_UFENCE ); +xe_create_buffer (cmd_buf); + cmd_buf->exec_queue =xe_exec_queue_create (cmd_buf->fd, cmd_buf->vm, eci,0 ); +fill_func (cmd_buf->cpu_addr, dst_va, dst_va1, val); +} +void xe_destroy_cmdbuf (struct xe_buffer *cmd_buf) {xe_exec_queue_destroy (cmd_buf->fd, cmd_buf->exec_queue);
lib/xe/xe_util.h +5 -0
@@ -34,13 +34,18 @@ struct xe_buffer { };typedef void (*cmdbuf_fill_func_t ) (uint32_t *batch,uint64_t dst_gpu_va,uint32_t val); +typedef void (*cmdbuf_fill_two_dw_func_t ) (uint32_t *batch,uint64_t dst_gpu_va, +uint64_t dst_gpu_va1,uint32_t val);void xe_create_buffer (struct xe_buffer *buffer);void xe_create_cmdbuf (struct xe_buffer *cmd_buf,cmdbuf_fill_func_t fill_func,uint64_t dst_va,uint32_t val,struct drm_xe_engine_class_instance *eci); +void xe_create_cmdbuf_fill_two_dw (struct xe_buffer *cmd_buf,cmdbuf_fill_two_dw_func_t fill_func, +uint64_t dst_va,uint64_t dst_va1,uint32_t val,struct drm_xe_engine_class_instance *eci);uint64_t xe_cmdbuf_exec_ufence_gpuva (struct xe_buffer *cmd_buf);uint64_t *xe_cmdbuf_exec_ufence_cpuva (struct xe_buffer *cmd_buf);void insert_store (uint32_t *batch,uint64_t dst_va,uint32_t val);void insert_atomic_inc (uint32_t *batch,uint64_t dst_va,uint32_t val); +void insert_memset (uint32_t *batch,uint64_t dst_va,uint64_t size,uint32_t val);void xe_submit_cmd (struct xe_buffer *cmdbuf);int64_t __xe_submit_cmd (struct xe_buffer *cmdbuf);void xe_destroy_buffer (struct xe_buffer *buffer);
tests/intel/xe_svm.c +46 -0
64 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v2 9/10 tests/intel/xe_svm: svm_mprotect
In reply to Bommu KrishnaiahVerify SVM functionality while accessing read only memory
--- tests/intel/xe_svm.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
tests/intel/xe_svm.c +38 -0
@@ -34,6 +34,8 @@* Description: verify SVM basic functionality by using GPU atomic access any location in malloc'ed memory * SUBTEST: svm_invalid_va * Description: verify SVM functionality while accessing invalid address +* SUBTEST: svm-mprotect +* Description: verify SVM functionality while accessing read only memory * SUBTEST: svm-benchmark * Description: verify SVM performance with simple benchmark test */
@@ -256,6 +258,38 @@ static void svm_invalid_va(int fd, uint32_t vm, struct drm_xe_engine_class_instafree (dst); } +/** +* Use mprotect to mark a chunk of memory to be read only and submit +* GPU command to write to this read only memory. GPU write should +* fail and driver should detect an invalid access error. +*/ +static void svm_mprotect (int fd,uint32_t vm,struct drm_xe_engine_class_instance *eci) +{ +uint64_t gpu_va =0x1a0000 ; +size_t bo_size =xe_bb_size (fd,PAGE_ALIGN_UFENCE ); +uint32_t *dst; +uint32_t size =65536 ; + +struct xe_buffer cmd_buf = { + .fd = fd, + .gpu_addr = (void *)(uintptr_t )gpu_va, + .vm = vm, + .size = bo_size, + .placement =vram_if_possible (fd, eci->gt_id), + .flag =DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM , + }; + + dst =aligned_alloc (size, size); +mprotect (dst, size,PROT_READ ); + +xe_create_cmdbuf (&cmd_buf, insert_store, (uint64_t )dst,0xc0ffee , eci); + +igt_assert_eq (__xe_submit_cmd (&cmd_buf), -EIO ); + +xe_destroy_cmdbuf (&cmd_buf); +free (dst); +} +/** * A simple benchmark test. * Use GPU to memset a buffer with specific value and
@@ -338,6 +372,10 @@ igt_mainxe_for_each_engine (fd, hwe)svm_invalid_va (fd, vm, hwe); + igt_subtest_f("svm-mprotect") +xe_for_each_engine (fd, hwe) +svm_mprotect (fd, vm, hwe); + igt_subtest_f("svm-benchmark")xe_for_each_engine (fd, hwe)svm_benchmark (fd, vm, hwe);
Signature · 1 line
2.25.1
PATCH v2 10/10 tests/intel/xe_svm: svm-sparse-access
In reply to Bommu KrishnaiahVerify Sparsely access two memory locations with svm
--- lib/xe/xe_util.c | 15 +++++++++++++++ lib/xe/xe_util.h | 1 + tests/intel/xe_svm.c | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+)
lib/xe/xe_util.c +15 -0
@@ -142,6 +142,21 @@ void insert_memset(uint32_t *batch, uint64_t dst_va, uint64_t size, uint32_t val *batch++ =MI_BATCH_BUFFER_END ; } +void insert_two_stores (uint32_t *batch,uint64_t dst_va,uint64_t dst_va1,uint32_t val) +{ +int i =0 ; + + batch[i] =MI_STORE_DWORD_IMM ; + batch[++i] = dst_va; + batch[++i] = dst_va >>32 ; + batch[++i] = val; + batch[++i] =MI_STORE_DWORD_IMM ; + batch[++i] = dst_va1; + batch[++i] = dst_va1 >>32 ; + batch[++i] = val; + batch[++i] =MI_BATCH_BUFFER_END ; +} +void xe_create_cmdbuf (struct xe_buffer *cmd_buf,cmdbuf_fill_func_t fill_func,uint64_t dst_va,uint32_t val,struct drm_xe_engine_class_instance *eci) {//make some room for a exec_ufence, which will be used to sync the
lib/xe/xe_util.h +1 -0
@@ -46,6 +46,7 @@ uint64_t *xe_cmdbuf_exec_ufence_cpuva(struct xe_buffer *cmd_buf);void insert_store (uint32_t *batch,uint64_t dst_va,uint32_t val);void insert_atomic_inc (uint32_t *batch,uint64_t dst_va,uint32_t val);void insert_memset (uint32_t *batch,uint64_t dst_va,uint64_t size,uint32_t val); +void insert_two_stores (uint32_t *batch,uint64_t dst_va,uint64_t dst_va1,uint32_t val);void xe_submit_cmd (struct xe_buffer *cmdbuf);int64_t __xe_submit_cmd (struct xe_buffer *cmdbuf);void xe_destroy_buffer (struct xe_buffer *buffer);
tests/intel/xe_svm.c +39 -0
@@ -38,6 +38,8 @@* Description: verify SVM functionality while accessing read only memory * SUBTEST: svm-benchmark * Description: verify SVM performance with simple benchmark test +* SUBTEST: svm-sparse-access +* Description: verify Sparsely access two memory locations with svm */ #include <fcntl.h>
@@ -330,6 +332,39 @@ static void svm_benchmark(int fd, uint32_t vm, struct drm_xe_engine_class_instanigt_info ("engine class %d, engine id %d memset E2E bandwidth(include sync overhead) %.3f MiB/s\n" , eci->engine_class, eci->engine_instance, bandwidth); } +/** +* Sparsely access two memory locations +*/ +static void svm_sparse_access (int fd,uint32_t vm,struct drm_xe_engine_class_instance *eci) +{ +uint64_t gpu_va =0x1a0000 ; +size_t bo_size =xe_bb_size (fd,PAGE_ALIGN_UFENCE ); +uint32_t size =1024 *1024 , sz_dw = size/4 ; +uint32_t *dst, *dst_to_access, *dst_to_access1; + +struct xe_buffer cmd_buf = { + .fd = fd, + .gpu_addr = (void *)(uintptr_t )gpu_va, + .vm = vm, + .size = bo_size, + .placement =vram_if_possible (fd, eci->gt_id), + .flag =DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM , + }; + + dst =malloc (size); + dst_to_access = dst + (sz_dw>>1 ); + dst_to_access1 = dst + (sz_dw>>2 ); + +xe_create_cmdbuf_fill_two_dw (&cmd_buf, insert_two_stores, (uint64_t )dst_to_access, (uint64_t )dst_to_access1,0xc0ffee , eci); +xe_submit_cmd (&cmd_buf); + +igt_assert_eq (*dst_to_access,0xc0ffee ); +igt_assert_eq (*dst_to_access1,0xc0ffee ); + +xe_destroy_cmdbuf (&cmd_buf); +free (dst); +} + igt_main {int fd;
@@ -380,6 +415,10 @@ igt_mainxe_for_each_engine (fd, hwe)svm_benchmark (fd, vm, hwe); + igt_subtest_f("svm-sparse-access") +xe_for_each_engine (fd, hwe) +svm_sparse_access (fd, vm, hwe); + igt_fixture {xe_vm_destroy (fd, vm);drm_close_driver (fd);
Signature · 1 line
2.25.1
Patchwork
CI✗ Fi.CI.BUILD: failure for helper function (rev2)
In reply to Bommu Krishnaiah== Series Details ==
== Series Details ==
Series: helper function (rev2)
URL : https://patchwork.freedesktop.org/series/133096/
State : failure
== Summary ==
IGT patchset build failed on latest successful build be9b9992805df48e785b40ac2c4d001fb680a2c1 tests/kms_ccs: Test XRGB2101010
Tail of build.log:
[1647/1682] Linking target runner/igt_results.
[1648/1682] Linking target tools/lsgpu.
[1649/1682] Linking target tools/msm_dp_compliance.
[1650/1682] Linking target runner/testdata/no-subtests.
[1651/1682] Linking target runner/testdata/successtest.
[1652/1682] Linking target runner/testdata/abort-simple.
[1653/1682] Generating gem_stress.testlist with a meson_exe.py custom command.
[1654/1682] Linking target runner/testdata/dynamic.
[1655/1682] Linking target runner/igt_resume.
[1656/1682] Linking target runner/igt_runner.
[1657/1682] Linking target runner/runner_json_test.
[1658/1682] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_mtlgt3.c.o'.
[1659/1682] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt1.c.o'.
[1660/1682] Compiling C object 'runner/527aa9f@@runner_test@exe/runner_tests.c.o'.
[1661/1682] Linking target runner/runner_test.
[1662/1682] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt2.c.o'.
[1663/1682] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt3.c.o'.
[1664/1682] Linking target lib/libi915_perf.so.1.5.
[1665/1682] Generating symbol file 'lib/76b5a35@@i915_perf@sha/libi915_perf.so.1.5.symbols'.
[1666/1682] Linking target tools/i915-perf/i915-perf-configs.
[1667/1682] Linking target tools/i915-perf/i915-perf-recorder.
[1668/1682] Linking target tools/i915-perf/i915-perf-reader.
[1669/1682] Linking target tests/core_hotunplug.
[1670/1682] Linking target tests/gem_barrier_race.
[1671/1682] Linking target tests/perf.
[1672/1682] Generating core_hotunplug.testlist with a meson_exe.py custom command.
[1673/1682] Generating gem_barrier_race.testlist with a meson_exe.py custom command.
[1674/1682] Generating perf.testlist with a meson_exe.py custom command.
[1675/1682] Generating xe_tests.rst with a custom command.
FAILED: docs/testplan/xe_tests.rst/usr/src/igt-gpu-tools/scripts/igt_doc.py --config /usr/src/igt-gpu-tools/tests/intel/xe_test_config.json --rest docs/testplan/xe_tests.rst --check-testlist --igt-build-path /opt/igt/build
Warning: igt@xe_svm@svm-atomic-access Category documentation is missing
Warning: igt@xe_svm@svm-basic-malloc Category documentation is missing
Warning: igt@xe_svm@svm-basic-mmap Category documentation is missing
Warning: igt@xe_svm@svm-benchmark Category documentation is missing
Warning: igt@xe_svm@svm-huge-page Category documentation is missing
Warning: igt@xe_svm@svm-mprotect Category documentation is missing
Warning: igt@xe_svm@svm-random-access Category documentation is missing
Warning: igt@xe_svm@svm-sparse-access Category documentation is missing
Warning: igt@xe_svm@svm_invalid_va Category documentation is missing
Warning: igt@xe_svm@xe_basic Category documentation is missing
Warning: Documented igt@xe_svm@svm_invalid_va doesn't exist on source files
Warning: Documented igt@xe_svm@xe_basic doesn't exist on source files
Warning: Missing documentation for igt@xe_svm@svm-invalid-va
Warning: Missing documentation for igt@xe_svm@xe-basic
Please refer: docs/test_documentation.md for more details
[1676/1682] Generating i915_tests.rst with a custom command.
[1677/1682] Generating kms_tests.rst with a custom command.
[1678/1682] Generating intel-ci-tests with a custom command.
ninja: build stopped: subcommand failed.
Patchwork
CI✗ GitLab.Pipeline: warning for helper function (rev2)
In reply to Bommu Krishnaiah== Series Details ==
== Series Details ==
Series: helper function (rev2)
URL : https://patchwork.freedesktop.org/series/133096/
State : warning
== Summary ==
Pipeline status: FAILED.
see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/1177054 for the overview.
build:tests-debian-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/58697849):
Warning: igt@xe_svm@svm-basic-mmap Category documentation is missing
Warning: igt@xe_svm@svm-benchmark Category documentation is missing
Warning: igt@xe_svm@svm-huge-page Category documentation is missing
Warning: igt@xe_svm@svm-mprotect Category documentation is missing
Warning: igt@xe_svm@svm-random-access Category documentation is missing
Warning: igt@xe_svm@svm-sparse-access Category documentation is missing
Warning: igt@xe_svm@svm_invalid_va Category documentation is missing
Warning: igt@xe_svm@xe_basic Category documentation is missing
Warning: Documented igt@xe_svm@svm_invalid_va doesn't exist on source files
Warning: Documented igt@xe_svm@xe_basic doesn't exist on source files
Warning: Missing documentation for igt@xe_svm@svm-invalid-va
Warning: Missing documentation for igt@xe_svm@xe-basic
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1715673253:step_script
section_start:1715673253:cleanup_file_variables
Cleaning up project directory and file based variables section_end:1715673254:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-debian-meson-armhf has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/58697851):
^
../lib/xe/xe_util.c: In function ‘xe_destroy_buffer’:
../lib/xe/xe_util.c:80:15: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
sync->addr = (uint64_t)buffer->bind_ufence;
^
../lib/xe/xe_util.c:82:68: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
xe_vm_unbind_async(buffer->fd, buffer->vm, buffer->bind_queue, 0, (uint64_t)buffer->gpu_addr, buffer->size, sync, 1);
^
../lib/xe/xe_util.c: In function ‘xe_cmdbuf_exec_ufence_gpuva’:
../lib/xe/xe_util.c:191:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
return (uint64_t)cmd_buf->gpu_addr + cmd_buf->size - 8;
^ cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed. section_end:1715673195:step_script section_start:1715673195:cleanup_file_variables Cleaning up project directory and file based variables section_end:1715673196:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-debian-meson-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/58697853):
^
../lib/xe/xe_util.c: In function ‘xe_destroy_buffer’:
../lib/xe/xe_util.c:80:15: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
sync->addr = (uint64_t)buffer->bind_ufence;
^
../lib/xe/xe_util.c:82:68: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
xe_vm_unbind_async(buffer->fd, buffer->vm, buffer->bind_queue, 0, (uint64_t)buffer->gpu_addr, buffer->size, sync, 1);
^
../lib/xe/xe_util.c: In function ‘xe_cmdbuf_exec_ufence_gpuva’:
../lib/xe/xe_util.c:191:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
return (uint64_t)cmd_buf->gpu_addr + cmd_buf->size - 8;
^ cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed. section_end:1715673195:step_script section_start:1715673195:cleanup_file_variables Cleaning up project directory and file based variables section_end:1715673196:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/58697844):
Warning: igt@xe_svm@svm-basic-mmap Category documentation is missing
Warning: igt@xe_svm@svm-benchmark Category documentation is missing
Warning: igt@xe_svm@svm-huge-page Category documentation is missing
Warning: igt@xe_svm@svm-mprotect Category documentation is missing
Warning: igt@xe_svm@svm-random-access Category documentation is missing
Warning: igt@xe_svm@svm-sparse-access Category documentation is missing
Warning: igt@xe_svm@svm_invalid_va Category documentation is missing
Warning: igt@xe_svm@xe_basic Category documentation is missing
Warning: Documented igt@xe_svm@svm_invalid_va doesn't exist on source files
Warning: Documented igt@xe_svm@xe_basic doesn't exist on source files
Warning: Missing documentation for igt@xe_svm@svm-invalid-va
Warning: Missing documentation for igt@xe_svm@xe-basic
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1715673241:step_script section_start:1715673241:cleanup_file_variables
Cleaning up project directory and file based variables section_end:1715673242:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-clang has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/58697848):
Warning: igt@xe_svm@svm-basic-mmap Category documentation is missing
Warning: igt@xe_svm@svm-benchmark Category documentation is missing
Warning: igt@xe_svm@svm-huge-page Category documentation is missing
Warning: igt@xe_svm@svm-mprotect Category documentation is missing
Warning: igt@xe_svm@svm-random-access Category documentation is missing
Warning: igt@xe_svm@svm-sparse-access Category documentation is missing
Warning: igt@xe_svm@svm_invalid_va Category documentation is missing
Warning: igt@xe_svm@xe_basic Category documentation is missing
Warning: Documented igt@xe_svm@svm_invalid_va doesn't exist on source files
Warning: Documented igt@xe_svm@xe_basic doesn't exist on source files
Warning: Missing documentation for igt@xe_svm@svm-invalid-va
Warning: Missing documentation for igt@xe_svm@xe-basic
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1715673267:step_script
section_start:1715673267:cleanup_file_variables
Cleaning up project directory and file based variables section_end:1715673268:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-no-libdrm-nouveau has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/58697847):
Warning: igt@xe_svm@svm-basic-mmap Category documentation is missing
Warning: igt@xe_svm@svm-benchmark Category documentation is missing
Warning: igt@xe_svm@svm-huge-page Category documentation is missing
Warning: igt@xe_svm@svm-mprotect Category documentation is missing
Warning: igt@xe_svm@svm-random-access Category documentation is missing
Warning: igt@xe_svm@svm-sparse-access Category documentation is missing
Warning: igt@xe_svm@svm_invalid_va Category documentation is missing
Warning: igt@xe_svm@xe_basic Category documentation is missing
Warning: Documented igt@xe_svm@svm_invalid_va doesn't exist on source files
Warning: Documented igt@xe_svm@xe_basic doesn't exist on source files
Warning: Missing documentation for igt@xe_svm@svm-invalid-va
Warning: Missing documentation for igt@xe_svm@xe-basic
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1715673249:step_script
section_start:1715673249:cleanup_file_variables
Cleaning up project directory and file based variables section_end:1715673249:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-no-libunwind has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/58697845):
Warning: igt@xe_svm@svm-basic-mmap Category documentation is missing
Warning: igt@xe_svm@svm-benchmark Category documentation is missing
Warning: igt@xe_svm@svm-huge-page Category documentation is missing
Warning: igt@xe_svm@svm-mprotect Category documentation is missing
Warning: igt@xe_svm@svm-random-access Category documentation is missing
Warning: igt@xe_svm@svm-sparse-access Category documentation is missing
Warning: igt@xe_svm@svm_invalid_va Category documentation is missing
Warning: igt@xe_svm@xe_basic Category documentation is missing
Warning: Documented igt@xe_svm@svm_invalid_va doesn't exist on source files
Warning: Documented igt@xe_svm@xe_basic doesn't exist on source files
Warning: Missing documentation for igt@xe_svm@svm-invalid-va
Warning: Missing documentation for igt@xe_svm@xe-basic
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1715673238:step_script
section_start:1715673238:cleanup_file_variables
Cleaning up project directory and file based variables section_end:1715673239:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-oldest-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/58697846):
Warning: igt@xe_svm@svm-basic-mmap Category documentation is missing
Warning: igt@xe_svm@svm-benchmark Category documentation is missing
Warning: igt@xe_svm@svm-huge-page Category documentation is missing
Warning: igt@xe_svm@svm-mprotect Category documentation is missing
Warning: igt@xe_svm@svm-random-access Category documentation is missing
Warning: igt@xe_svm@svm-sparse-access Category documentation is missing
Warning: igt@xe_svm@svm_invalid_va Category documentation is missing
Warning: igt@xe_svm@xe_basic Category documentation is missing
Warning: Documented igt@xe_svm@svm_invalid_va doesn't exist on source files
Warning: Documented igt@xe_svm@xe_basic doesn't exist on source files
Warning: Missing documentation for igt@xe_svm@svm-invalid-va
Warning: Missing documentation for igt@xe_svm@xe-basic
Please refer: docs/test_documentation.md for more details
ninja: build stopped: subcommand failed.
section_end:1715673238:step_script
section_start:1715673238:cleanup_file_variables
Cleaning up project directory and file based variables section_end:1715673239:cleanup_file_variables
ERROR: Job failed: exit code 1
== Logs ==
For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/1177054
Hi Bommu,
Quoted 5 lines · Bommu Krishnaiah
Introduce helper functions for object creation, binding, submission, and destruction, applicable for SVM and other tests
xe-basic test is validating the helper function introduced in '
lib/xe/xe_util: helper function'
Quoted 8 lines
svm test cases:
svm-basic-malloc
svm-basic-mmap
svm-random-access
svm-huge-page
svm-atomic-access
svm-atomic-accesssvm_invalid_va
---- ^
No underscores in tests names.
Quoted 8 lines
svm-mprotect
svm-benchmark
svm-sparse-accesssvm kernel implimentation:
https://gitlab.freedesktop.org/oak/xe-kernel-driver-svm.git
branch: origin/drm-xe-next-svm-unify-userptr
Please improve and then resend with another subject, 'helper function' is misleading. What about 'Add tests for Shared Virtual Memory (SVM)'?
Quoted 7 lines
Bommu Krishnaiah (10):
lib/xe/xe_util: Introduce helper functions for buffer creation and
command submission etc
tests/intel/xe_svm: basicxe_svmtest
tests/xe_svm: basic svm test
tests/intel/xe_svm:svm_random_access
-------------------------- ^
svm-random-access
Quoted 2 lines
tests/intel/xe_svm: svm-huge-page
tests/intel/xe_svm:svm_atomic_access
-------------------------- ^
svm-atomic-access
Quoted 2 lines
tests/intel/xe_svm: svm-invalid-va
tests/intel/xe_svm:svm_benchmark
svm-benchmark
Quoted 1 line
tests/intel/xe_svm:
svm_mprotect
svm-mprotect
Quoted 1 line
tests/intel/xe_svm: svm-sparse-access
Regards,
Kamil
Quoted 12 lines
include/drm-uapi/xe_drm.h | 2 + lib/xe/xe_util.c | 186 +++++++++++++++++ lib/xe/xe_util.h | 40 ++++ tests/intel/xe_svm.c | 427 ++++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 5 files changed, 656 insertions(+) create mode 100644 tests/intel/xe_svm.cSignature · 1 line
2.25.1