libdrm tests for hot-unplug feature
cover libdrm tests for hot-unplug feature
Adding some tests to acompany the recently added hot-unplug feature. For now the test suite is disabled until the feature propagates from drm-misc-next to drm-next.
Andrey Grodzovsky (7):
tests/amdgpu: Fix valgrind warning
xf86drm: Add function to retrieve char device path test/amdgpu: Add helper functions for hot unplug test/amdgpu/hotunplug: Add test suite for GPU unplug test/amdgpu/hotunplug: Add basic test tests/amdgpu/hotunplug: Add unplug with cs test. tests/amdgpu/hotunplug: Add hotunplug with exported bo test
tests/amdgpu/amdgpu_test.c | 42 +++- tests/amdgpu/amdgpu_test.h | 26 +++ tests/amdgpu/basic_tests.c | 5 +- tests/amdgpu/hotunplug_tests.c | 357 +++++++++++++++++++++++++++++++++ tests/amdgpu/meson.build | 1 + xf86drm.c | 23 +++ xf86drm.h | 1 + 7 files changed, 450 insertions(+), 5 deletions(-) create mode 100644 tests/amdgpu/hotunplug_tests.c
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/7 tests/amdgpu: Fix valgrind warning
Struct access after free
--- tests/amdgpu/basic_tests.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tests/amdgpu/basic_tests.c +3 -2
@@ -626,13 +626,14 @@ CU_BOOL suite_basic_tests_enable(void) &minor_version, &device_handle))return CU_FALSE ; -if (amdgpu_device_deinitialize (device_handle)) -return CU_FALSE ; family_id = device_handle->info.family_id; chip_id = device_handle->info.chip_external_rev; chip_rev = device_handle->info.chip_rev; +if (amdgpu_device_deinitialize (device_handle)) +return CU_FALSE ; +/* disable gfx engine basic test cases for some asics have no CPG */ if (asic_is_gfx_pipe_removed (family_id, chip_id, chip_rev)) { if (amdgpu_set_test_active("Basic Tests",
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/7 xf86drm: Add function to retrieve char device path
In reply to Andrey GrodzovskyUsed to access device controls
--- xf86drm.c | 23 +++++++++++++++++++++++ xf86drm.h | 1 + 2 files changed, 24 insertions(+)
xf86drm.c +23 -0
@@ -4361,6 +4361,29 @@ drm_public char *drmGetDeviceNameFromFd2(int fd)#endif } +drm_public char *drmGetCharDeviceFromFd(int fd) +{ +#ifdef __linux__ +struct stat sbuf; +char path[PATH_MAX +1 ]; +unsigned int maj, min; + +if (fstat (fd, &sbuf)) +return NULL ; + + maj =major (sbuf.st_rdev); + min =minor (sbuf.st_rdev); + +if (!drmNodeIsDRM (maj, min) || !S_ISCHR (sbuf.st_mode)) +return NULL ; + +snprintf (path,sizeof (path),"/sys/dev/char/%d:%d" , maj, min); +return strdup (path); +#else +return NULL ; +#endif +} + drm_public int drmSyncobjCreate(int fd, uint32_t flags, uint32_t *handle) {struct drm_syncobj_create args;
xf86drm.h +1 -0
@@ -812,6 +812,7 @@ extern char *drmGetDeviceNameFromFd(int fd);*/ extern char *drmGetDeviceNameFromFd2 (int fd);extern int drmGetNodeTypeFromFd (int fd); +extern char *drmGetCharDeviceFromFd (int fd);/* Convert between GEM handles and DMA-BUF file descriptors. *
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/7] xf86drm: Add function to retrieve char device path
Do we really need to make this a public API?
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/7] xf86drm: Add function to retrieve char device path
It calls drmNodeIsDRM which is private function itself so - if i implement it in amdgpu part I still need to expose drmNodeIsDRM. Note that this function is basically a subset of drmGetDeviceNameFromFd2
Andrey
Quoted 1 line · Simon Ser
Do we really need to make this a public API?
PATCH 3/7 test/amdgpu: Add helper functions for hot unplug
In reply to Andrey GrodzovskyExpose close device and add open device wich preserves test index.
--- tests/amdgpu/amdgpu_test.c | 31 ++++++++++++++++++++++++++++--- tests/amdgpu/amdgpu_test.h | 3 +++ 2 files changed, 31 insertions(+), 3 deletions(-)
tests/amdgpu/amdgpu_test.c +28 -3
@@ -339,12 +339,13 @@ static int amdgpu_open_devices(int open_render_node)/* Close AMD devices. */ -static void amdgpu_close_devices () +void amdgpu_close_devices () {int i;for (i =0 ; i <MAX_CARDS_SUPPORTED ; i++) -if (drm_amdgpu[i] >=0 ) +if (drm_amdgpu[i] >=0 ) {close (drm_amdgpu[i]); + } }/* Print AMD devices information */
@@ -520,6 +521,31 @@ static void amdgpu_disable_suites()fprintf (stderr,"test deactivation failed - %s\n" ,CU_get_error_msg ()); } +int test_device_index; + +int amdgpu_open_device_on_test_index (int render_node) +{ +int i; + +if (amdgpu_open_devices (open_render_node) <=0 ) { +perror ("Cannot open AMDGPU device" ); +return -1 ; + } + +if (test_device_index >=0 ) { +/* Most tests run on device of drm_amdgpu[0]. +* Swap the chosen device to drm_amdgpu[0]. +*/ + i = drm_amdgpu[0 ]; + drm_amdgpu[0 ] = drm_amdgpu[test_device_index]; + drm_amdgpu[test_device_index] = i; + } + +return 0 ; + + +} +/* The main() function for setting up and running the tests. * Returns a CUE_SUCCESS on successful running, another * CUnit error code on failure.
@@ -535,7 +561,6 @@ int main(int argc, char **argv)int display_devices =0 ;/* By default not to display devices' info */ CU_pSuite pSuite =NULL ;CU_pTest pTest =NULL ; -int test_device_index;int display_list =0 ;int force_run =0 ;
tests/amdgpu/amdgpu_test.h +3 -0
@@ -476,4 +476,7 @@ void amdgpu_test_exec_cs_helper_raw(amdgpu_device_handle device_handle,struct amdgpu_cs_request *ibs_request, bool secure); +void amdgpu_close_devices (); +int amdgpu_open_device_on_test_index (int render_node); +#endif /* #ifdef _AMDGPU_TEST_H_ */
Signature · 1 line
2.25.1
PATCH 4/7 test/amdgpu/hotunplug: Add test suite for GPU unplug
In reply to Andrey GrodzovskyAdd just the test suite skeleton.
--- tests/amdgpu/amdgpu_test.c | 11 ++++ tests/amdgpu/amdgpu_test.h | 23 +++++++ tests/amdgpu/hotunplug_tests.c | 116 +++++++++++++++++++++++++++++++++ tests/amdgpu/meson.build | 1 + 4 files changed, 151 insertions(+) create mode 100644 tests/amdgpu/hotunplug_tests.c
tests/amdgpu/amdgpu_test.c +11 -0
@@ -59,6 +59,7 @@#define RAS_TESTS_STR "RAS Tests"#define SYNCOBJ_TIMELINE_TESTS_STR "SYNCOBJ TIMELINE Tests"#define SECURITY_TESTS_STR "Security Tests" +#define HOTUNPLUG_TESTS_STR "Hotunplug Tests"/** * Open handles for amdgpu devices
@@ -137,6 +138,12 @@ static CU_SuiteInfo suites[] = { .pCleanupFunc = suite_security_tests_clean, .pTests = security_tests, }, + { + .pName = HOTUNPLUG_TESTS_STR, + .pInitFunc = suite_hotunplug_tests_init, + .pCleanupFunc = suite_hotunplug_tests_clean, + .pTests = hotunplug_tests, + }, CU_SUITE_INFO_NULL, };
@@ -198,6 +205,10 @@ static Suites_Active_Status suites_active_stat[] = { .pName = SECURITY_TESTS_STR, .pActive = suite_security_tests_enable, }, + { + .pName = HOTUNPLUG_TESTS_STR, + .pActive = suite_hotunplug_tests_enable, + }, };
tests/amdgpu/amdgpu_test.h +23 -0
@@ -273,6 +273,29 @@ amdgpu_command_submission_write_linear_helper_with_secure(amdgpu_device_handleunsigned ip_type, bool secure); + + +/** +* Initialize hotunplug test suite +*/ +int suite_hotunplug_tests_init (); + +/** +* Deinitialize hotunplug test suite +*/ +int suite_hotunplug_tests_clean (); + +/** +* Decide if the suite is enabled by default or not. +*/ +CU_BOOL suite_hotunplug_tests_enable (void ); + +/** +* Tests in uvd enc test suite +*/ +extern CU_TestInfo hotunplug_tests[]; + +/** * Helper functions */
tests/amdgpu/hotunplug_tests.c new file +116 -0
116 lines not on this page · raw message
tests/amdgpu/meson.build +1 -0
@@ -25,6 +25,7 @@ if dep_cunit.found() 'amdgpu_test.c', 'basic_tests.c', 'bo_tests.c', 'cs_tests.c', 'vce_tests.c', 'uvd_enc_tests.c', 'vcn_tests.c', 'deadlock_tests.c', 'vm_tests.c', 'ras_tests.c', 'syncobj_tests.c', 'security_tests.c', + 'hotunplug_tests.c' ), dependencies : [dep_cunit, dep_threads, dep_atomic_ops], include_directories : [inc_root, inc_drm, include_directories('../../amdgpu')],
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/7 test/amdgpu/hotunplug: Add basic test
In reply to Andrey GrodzovskyAdd plug/unplug device and open/close device file infrastrucutre.
Add basic test - unplug device while device file still open. Close device file afterwards and replug the device.
--- tests/amdgpu/hotunplug_tests.c | 135 +++++++++++++++++++++++++-------- 1 file changed, 105 insertions(+), 30 deletions(-)
tests/amdgpu/hotunplug_tests.c +105 -30
@@ -21,9 +21,11 @@* */ -#include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> #if HAVE_ALLOCA_H # include <alloca.h> #endif
@@ -33,40 +35,40 @@#include "amdgpu_test.h" #include "amdgpu_drm.h" #include "amdgpu_internal.h" - +#include "xf86drm.h" #include <pthread.h> static amdgpu_device_handle device_handle;static uint32_t major_version;static uint32_t minor_version; - -static uint32_t family_id; -static uint32_t chip_rev; -static uint32_t chip_id; +static char *sysfs_remove =NULL ;CU_BOOL suite_hotunplug_tests_enable (void ) {CU_BOOL enable =CU_TRUE ; +drmDevicePtr device; + +if (drmGetDevice2 (drm_amdgpu[0 ],DRM_DEVICE_GET_PCI_REVISION , &device)) { +printf ("\n\nGPU Failed to get DRM device PCI info!\n" ); +return CU_FALSE ; + } + +if (device->bustype !=DRM_BUS_PCI ) { +printf ("\n\nGPU device is not on PCI bus!\n" ); +amdgpu_device_deinitialize (device_handle); +return CU_FALSE ; + } + +/* Disable until the hot-unplug support in kernel gets into drm-next */ +if (major_version <0xff ) + enable = false;if (amdgpu_device_initialize (drm_amdgpu[0 ], &major_version, &minor_version, &device_handle))return CU_FALSE ; - family_id = device_handle->info.family_id; - chip_id = device_handle->info.chip_external_rev; - chip_rev = device_handle->info.chip_rev; - -/* -* Only enable for ASICs supporting GPU reset and for which it's enabled -* by default (currently GFX8/9 dGPUS) -*/ -if (family_id !=AMDGPU_FAMILY_VI && - family_id !=AMDGPU_FAMILY_AI && - family_id !=AMDGPU_FAMILY_CI ) { -printf ("\n\nGPU reset is not enabled for the ASIC, hotunplug suite disabled\n" ); - enable =CU_FALSE ; - } +/* TODO Once DRM version for unplug feature ready compare here agains it*/ if (amdgpu_device_deinitialize (device_handle))return CU_FALSE ;
@@ -75,8 +77,46 @@ CU_BOOL suite_hotunplug_tests_enable(void) }int suite_hotunplug_tests_init (void ) +{ +/* We need to open/close device at each test manually */ +amdgpu_close_devices (); + +return CUE_SUCCESS ; +} + +int suite_hotunplug_tests_clean (void ) +{ + + +return CUE_SUCCESS ; +} + +static int amdgpu_hotunplug_trigger (const char *pathname) +{ +int fd, len; + + fd =open (pathname,O_WRONLY ); +if (fd <0 ) +return -errno; + + len =write (fd,"1" ,1 ); +close (fd); + +return len; +} + +static int amdgpu_hotunplug_setup_test () {int r; +char *tmp_str; + +if (amdgpu_open_device_on_test_index (open_render_node) <=0 ) { +printf ("\n\n Failed to reopen device file!\n" ); +return CUE_SINIT_FAILED ; + + + + } r =amdgpu_device_initialize (drm_amdgpu[0 ], &major_version, &minor_version, &device_handle);
@@ -89,27 +129,62 @@ int suite_hotunplug_tests_init(void)return CUE_SINIT_FAILED ; } -return CUE_SUCCESS ; + tmp_str =drmGetCharDeviceFromFd (drm_amdgpu[0 ]); +if (!tmp_str){ +printf ("\n\n Device path not found!\n" ); +return CUE_SINIT_FAILED ; + } + + sysfs_remove =realloc (tmp_str,strlen (tmp_str) *2 ); +strcat (sysfs_remove,"/device/remove" ); + +return 0 ; + } -int suite_hotunplug_tests_clean (void ) +static int amdgpu_hotunplug_teardown_test () { -int r =amdgpu_device_deinitialize (device_handle); - -if (r ==0 ) -return CUE_SUCCESS ; -else +if (amdgpu_device_deinitialize (device_handle))return CUE_SCLEAN_FAILED ; + +amdgpu_close_devices (); + +if (sysfs_remove) +free (sysfs_remove); + +return 0 ; +} + +static inline int amdgpu_hotunplug_remove () +{ +return amdgpu_hotunplug_trigger (sysfs_remove); +} + +static inline int amdgpu_hotunplug_rescan () +{ +return amdgpu_hotunplug_trigger ("/sys/bus/pci/rescan" ); } -static void amdgpu_hotunplug_gfx (void ) +static void amdgpu_hotunplug_simple (void ) { -printf ("Hello!\n" ); +int r; + + r =amdgpu_hotunplug_setup_test (); +CU_ASSERT_EQUAL (r ,0 ); + + r =amdgpu_hotunplug_remove (); +CU_ASSERT_EQUAL (r >0 ,1 ); + + r =amdgpu_hotunplug_teardown_test (); +CU_ASSERT_EQUAL (r ,0 ); + + r =amdgpu_hotunplug_rescan (); +CU_ASSERT_EQUAL (r >0 ,1 ); }CU_TestInfo hotunplug_tests[] = { - {"gfx ring block test (set amdgpu.lockup_timeout=50)" , amdgpu_hotunplug_gfx }, + {"Unplug card and rescan the bus to plug it back" , amdgpu_hotunplug_simple },CU_TEST_INFO_NULL , };
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/7 tests/amdgpu/hotunplug: Add unplug with cs test.
In reply to Andrey GrodzovskySame as simple test but while doing cs
--- tests/amdgpu/hotunplug_tests.c | 128 ++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 2 deletions(-)
tests/amdgpu/hotunplug_tests.c +126 -2
@@ -38,11 +38,13 @@#include "xf86drm.h" #include <pthread.h> +#define GFX_COMPUTE_NOP 0xffff1000static amdgpu_device_handle device_handle;static uint32_t major_version;static uint32_t minor_version;static char *sysfs_remove =NULL ; +static bool do_cs;CU_BOOL suite_hotunplug_tests_enable (void ) {
@@ -110,7 +112,7 @@ static int amdgpu_hotunplug_setup_test()int r;char *tmp_str; -if (amdgpu_open_device_on_test_index (open_render_node) <=0 ) { +if (amdgpu_open_device_on_test_index (open_render_node) <0 ) {printf ("\n\n Failed to reopen device file!\n" );return CUE_SINIT_FAILED ;
@@ -165,17 +167,128 @@ static inline int amdgpu_hotunplug_rescan()return amdgpu_hotunplug_trigger ("/sys/bus/pci/rescan" ); } +static int amdgpu_cs_sync (amdgpu_context_handle context, +unsigned int ip_type, +int ring, +unsigned int seqno) +{ +struct amdgpu_cs_fence fence = { + .context = context, + .ip_type = ip_type, + .ring = ring, + .fence = seqno, + }; +uint32_t expired; + +return amdgpu_cs_query_fence_status (&fence, +AMDGPU_TIMEOUT_INFINITE , +0 , &expired); +} -static void amdgpu_hotunplug_simple (void ) +static void *amdgpu_nop_cs () +{ +amdgpu_bo_handle ib_result_handle; +void *ib_result_cpu; +uint64_t ib_result_mc_address; +uint32_t *ptr; +int i, r; +amdgpu_bo_list_handle bo_list; +amdgpu_va_handle va_handle; +amdgpu_context_handle context; +struct amdgpu_cs_request ibs_request; +struct amdgpu_cs_ib_info ib_info; + + r =amdgpu_cs_ctx_create (device_handle, &context); +CU_ASSERT_EQUAL (r,0 ); + + r =amdgpu_bo_alloc_and_map (device_handle,4096 ,4096 , +AMDGPU_GEM_DOMAIN_GTT ,0 , + &ib_result_handle, &ib_result_cpu, + &ib_result_mc_address, &va_handle); +CU_ASSERT_EQUAL (r,0 ); + + ptr = ib_result_cpu; +for (i =0 ; i <16 ; ++i) + ptr[i] =GFX_COMPUTE_NOP ; + + r =amdgpu_bo_list_create (device_handle,1 , &ib_result_handle,NULL , &bo_list); +CU_ASSERT_EQUAL (r,0 ); + +memset (&ib_info,0 ,sizeof (struct amdgpu_cs_ib_info )); + ib_info.ib_mc_address = ib_result_mc_address; + ib_info.size =16 ; + +memset (&ibs_request,0 ,sizeof (struct amdgpu_cs_request )); + ibs_request.ip_type =AMDGPU_HW_IP_GFX ; + ibs_request.ring =0 ; + ibs_request.number_of_ibs =1 ; + ibs_request.ibs = &ib_info; + ibs_request.resources = bo_list; + +while (do_cs) +amdgpu_cs_submit (context,0 , &ibs_request,1 ); + + r =amdgpu_cs_sync (context,AMDGPU_HW_IP_GFX ,0 , ibs_request.seq_no); +CU_ASSERT_EQUAL ((r ==0 || r == -ECANCELED ),1 ); + +amdgpu_bo_list_destroy (bo_list); +amdgpu_bo_unmap_and_free (ib_result_handle, va_handle, + ib_result_mc_address,4096 ); + +amdgpu_cs_ctx_free (context); + +return (void *)0 ; +} + +static pthread_t *amdgpu_create_cs_thread () +{ +int r; +pthread_t *thread =malloc (sizeof (*thread)); +if (!thread) +return NULL ; + + do_cs = true; + + r =pthread_create (thread,NULL , amdgpu_nop_cs,NULL ); +CU_ASSERT_EQUAL (r,0 ); + +/* Give thread enough time to start*/ +usleep (100000 ); +return thread; +} + +static void amdgpu_destroy_cs_thread (pthread_t *thread) +{ +void *status; + + do_cs = false; + +pthread_join (*thread, &status); +CU_ASSERT_EQUAL (status,0 ); + +free (thread); +} + + +static void amdgpu_hotunplug_test (bool with_cs) {int r; +pthread_t *thread =NULL ; r =amdgpu_hotunplug_setup_test ();CU_ASSERT_EQUAL (r ,0 ); +if (with_cs) { + thread =amdgpu_create_cs_thread (); +CU_ASSERT_NOT_EQUAL (thread,NULL ); + } + r =amdgpu_hotunplug_remove ();CU_ASSERT_EQUAL (r >0 ,1 ); +if (with_cs) +amdgpu_destroy_cs_thread (thread); + r =amdgpu_hotunplug_teardown_test ();CU_ASSERT_EQUAL (r ,0 );
@@ -183,8 +296,19 @@ static void amdgpu_hotunplug_simple(void)CU_ASSERT_EQUAL (r >0 ,1 ); } +static void amdgpu_hotunplug_simple (void ) +{ +amdgpu_hotunplug_test (false); +} + +static void amdgpu_hotunplug_with_cs (void ) +{ +amdgpu_hotunplug_test (true); +} +CU_TestInfo hotunplug_tests[] = { {"Unplug card and rescan the bus to plug it back" , amdgpu_hotunplug_simple }, + {"Same as first test but with command submission" , amdgpu_hotunplug_with_cs },CU_TEST_INFO_NULL , };
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/7 tests/amdgpu/hotunplug: Add hotunplug with exported bo test
In reply to Andrey GrodzovskyDisconnect device while BO is exported.
--- tests/amdgpu/hotunplug_tests.c | 46 ++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-)
tests/amdgpu/hotunplug_tests.c +44 -2
@@ -306,10 +306,52 @@ static void amdgpu_hotunplug_with_cs(void)amdgpu_hotunplug_test (true); } +static void amdgpu_hotunplug_with_exported_bo (void ) +{ +int r; +uint32_t dma_buf_fd; +unsigned int *ptr; +amdgpu_bo_handle bo_handle; + +struct amdgpu_bo_alloc_request request = { + .alloc_size =4096 , + .phys_alignment =4096 , + .preferred_heap =AMDGPU_GEM_DOMAIN_GTT , + .flags =0 , + }; + + r =amdgpu_hotunplug_setup_test (); +CU_ASSERT_EQUAL (r ,0 ); + +amdgpu_bo_alloc (device_handle, &request, &bo_handle); +CU_ASSERT_EQUAL (r,0 ); + + r =amdgpu_bo_export (bo_handle, amdgpu_bo_handle_type_dma_buf_fd, &dma_buf_fd); +CU_ASSERT_EQUAL (r,0 ); + + ptr =mmap (NULL ,4096 ,PROT_READ |PROT_WRITE ,MAP_SHARED , dma_buf_fd,0 ); +CU_ASSERT_NOT_EQUAL (ptr,MAP_FAILED ); + + r =amdgpu_hotunplug_remove (); +CU_ASSERT_EQUAL (r >0 ,1 ); + +amdgpu_bo_free (bo_handle); + + r =amdgpu_hotunplug_teardown_test (); +CU_ASSERT_EQUAL (r ,0 ); + + *ptr =0xdeafbeef ; + +munmap (ptr,4096 ); +close (dma_buf_fd); + + r =amdgpu_hotunplug_rescan (); +CU_ASSERT_EQUAL (r >0 ,1 ); +} +CU_TestInfo hotunplug_tests[] = { {"Unplug card and rescan the bus to plug it back" , amdgpu_hotunplug_simple }, {"Same as first test but with command submission" , amdgpu_hotunplug_with_cs }, + {"Unplug with exported bo" , amdgpu_hotunplug_with_exported_bo },CU_TEST_INFO_NULL , }; - -
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines · Andrey Grodzovsky
Adding some tests to acompany the recently added hot-unplug feature. For now the test suite is disabled until the feature propagates from drm-misc-next to drm-next.
Quoted 8 lines
Andrey Grodzovsky (7):
tests/amdgpu: Fix valgrind warning
xf86drm: Add function to retrieve char device path test/amdgpu: Add helper functions for hot unplug test/amdgpu/hotunplug: Add test suite for GPU unplug test/amdgpu/hotunplug: Add basic test tests/amdgpu/hotunplug: Add unplug with cs test. tests/amdgpu/hotunplug: Add hotunplug with exported bo test
Given how nasty hotunplug is I really think collaborating on igt tests on this would be best for everyone ... do we have to keep doing parallel tests here for amdgpu?
-Daniel
Quoted 13 lines
tests/amdgpu/amdgpu_test.c | 42 +++- tests/amdgpu/amdgpu_test.h | 26 +++ tests/amdgpu/basic_tests.c | 5 +- tests/amdgpu/hotunplug_tests.c | 357 +++++++++++++++++++++++++++++++++ tests/amdgpu/meson.build | 1 + xf86drm.c | 23 +++ xf86drm.h | 1 + 7 files changed, 450 insertions(+), 5 deletions(-) create mode 100644 tests/amdgpu/hotunplug_tests.c--
2.25.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 14 lines · Daniel Vetter
Quoted 4 lines · Andrey Grodzovsky
Adding some tests to acompany the recently added hot-unplug feature. For now the test suite is disabled until the feature propagates from drm-misc-next to drm-next.
Quoted 8 lines
Andrey Grodzovsky (7):
tests/amdgpu: Fix valgrind warning
xf86drm: Add function to retrieve char device path test/amdgpu: Add helper functions for hot unplug test/amdgpu/hotunplug: Add test suite for GPU unplug test/amdgpu/hotunplug: Add basic test tests/amdgpu/hotunplug: Add unplug with cs test. tests/amdgpu/hotunplug: Add hotunplug with exported bo test
Quoted 4 lines
Given how nasty hotunplug is I really think collaborating on igt tests on this would be best for everyone ... do we have to keep doing parallel tests here for amdgpu?
-Daniel
AFAIK as far as AMD goes a lot of developers use libdrm for regression testing while developing their features and also QA as i can see from some internal ticket specifically opened for failing to pass libdrm tests. From my bitter experience with GPU reset - features which are not part of a common use case such as device loading, mode setting or commands submissions tend to very quickly break as people develop features but never test them in those uncommon use cases - this is why I feel it will be very helpful to include those tests in libdrm.
Also given that this is libdrm amdgpu code it fits naturally into libdrm.
Regarding IGT - as you may remember I have them there too - https://gitlab.freedesktop.org/agrodzov/igt-gpu-tools/-/commits/master
I hit some compile breakage on debian platform there which i need to resolve before i will submit for review there too.
Andrey
Quoted 11 lines
Quoted 11 lines
tests/amdgpu/amdgpu_test.c | 42 +++- tests/amdgpu/amdgpu_test.h | 26 +++ tests/amdgpu/basic_tests.c | 5 +- tests/amdgpu/hotunplug_tests.c | 357 +++++++++++++++++++++++++++++++++ tests/amdgpu/meson.build | 1 + xf86drm.c | 23 +++ xf86drm.h | 1 + 7 files changed, 450 insertions(+), 5 deletions(-)create mode 100644
tests/amdgpu/hotunplug_tests.c
Quoted 4 lines
Quoted 3 lines
--
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Ping
Andrey
Quoted 29 lines · Andrey Grodzovsky
Quoted 14 lines · Daniel Vetter
Quoted 4 lines · Andrey Grodzovsky
Adding some tests to acompany the recently added hot-unplug feature. For now the test suite is disabled until the feature propagates from drm-misc-next to drm-next.
Quoted 8 lines
Andrey Grodzovsky (7):
tests/amdgpu: Fix valgrind warning
xf86drm: Add function to retrieve char device path test/amdgpu: Add helper functions for hot unplug test/amdgpu/hotunplug: Add test suite for GPU unplug test/amdgpu/hotunplug: Add basic test tests/amdgpu/hotunplug: Add unplug with cs test. tests/amdgpu/hotunplug: Add hotunplug with exported bo testQuoted 4 lines
Given how nasty hotunplug is I really think collaborating on igt tests on this would be best for everyone ... do we have to keep doing parallel tests here for amdgpu?
-DanielAFAIK as far as AMD goes a lot of developers use libdrm for regression testing while developing their features and also QA as i can see from some internal ticket specifically opened for failing to pass libdrm tests. From my bitter experience with GPU reset - features which are not part of a common use case such as device loading, mode setting or commands submissions tend to very quickly break as people develop features but never test them in those uncommon use cases - this is why I feel it will be very helpful to include those tests in libdrm.
Quoted 24 lines
Also given that this is libdrm amdgpu code it fits naturally into libdrm.
Regarding IGT - as you may remember I have them there too - https://gitlab.freedesktop.org/agrodzov/igt-gpu-tools/-/commits/master
I hit some compile breakage on debian platform there which i need to resolve before i will submit for review there too.Andrey
Quoted 16 lines
Quoted 15 lines
tests/amdgpu/amdgpu_test.c | 42 +++- tests/amdgpu/amdgpu_test.h | 26 +++ tests/amdgpu/basic_tests.c | 5 +-
tests/amdgpu/hotunplug_tests.c| 357
+++++++++++++++++++++++++++++++++
tests/amdgpu/meson.build | 1 +
xf86drm.c | 23 +++
xf86drm.h | 1 +7 files changed, 450 insertions(+), 5 deletions(-)create mode 100644
tests/amdgpu/hotunplug_tests.cSignature · 1 line
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 46 lines · Andrey Grodzovsky
Ping
Andrey
Quoted 41 lines · Andrey Grodzovsky
Quoted 14 lines · Daniel Vetter
Quoted 4 lines · Andrey Grodzovsky
Adding some tests to acompany the recently added hot-unplug feature. For now the test suite is disabled until the feature propagates from drm-misc-next to drm-next.
Quoted 8 lines
Andrey Grodzovsky (7):
tests/amdgpu: Fix valgrind warning
xf86drm: Add function to retrieve char device path test/amdgpu: Add helper functions for hot unplug test/amdgpu/hotunplug: Add test suite for GPU unplug test/amdgpu/hotunplug: Add basic test tests/amdgpu/hotunplug: Add unplug with cs test. tests/amdgpu/hotunplug: Add hotunplug with exported bo testQuoted 4 lines
Given how nasty hotunplug is I really think collaborating on igt tests on this would be best for everyone ... do we have to keep doing parallel tests here for amdgpu?
-DanielAFAIK as far as AMD goes a lot of developers use libdrm for regression testing
while developing their features and also QA as i can see from some internal ticket
specifically opened for failing to pass libdrm tests. From my bitter experience with
GPU reset - features which are not part of a common use case such as device loading,
mode setting or commands submissions tend to very quickly break as people develop
features but never test them in those uncommon use cases - this is why I feel it will be
very helpful to include those tests in libdrm.Also given that this is libdrm amdgpu code it fits naturally into libdrm.
Regarding IGT - as you may remember I have them there too -
https://gitlab.freedesktop.org/agrodzov/igt-gpu-tools/-/commits/master
I hit some compile breakage on debian platform there which i need to resolve before i will submit for review there too.
Why can't amd run the igt tests? Afaiui on the display side this is happening already, at least sometimes.
And yes regression tests matter, it just feels silly that we need to have them 2x for amdgpu. For old stuff the old repo is all fine, but for new feature it looks a bit silly.
-Daniel
Quoted 20 lines
Quoted 20 lines
Andrey
Quoted 16 lines
Quoted 15 lines
tests/amdgpu/amdgpu_test.c | 42 +++- tests/amdgpu/amdgpu_test.h | 26 +++ tests/amdgpu/basic_tests.c | 5 +-
tests/amdgpu/hotunplug_tests.c| 357
+++++++++++++++++++++++++++++++++
tests/amdgpu/meson.build | 1 +
xf86drm.c | 23 +++
xf86drm.h | 1 +7 files changed, 450 insertions(+), 5 deletions(-)create mode 100644
tests/amdgpu/hotunplug_tests.cSignature · 1 line
2.25.1
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Quoted 49 lines · Daniel Vetter
Quoted 46 lines · Andrey Grodzovsky
Ping
Andrey
Quoted 41 lines · Andrey Grodzovsky
Quoted 14 lines · Daniel Vetter
Quoted 4 lines · Andrey Grodzovsky
Adding some tests to acompany the recently added hot-unplug feature. For now the test suite is disabled until the feature propagates from drm-misc-next to drm-next.
Quoted 8 lines
Andrey Grodzovsky (7):
tests/amdgpu: Fix valgrind warning
xf86drm: Add function to retrieve char device path test/amdgpu: Add helper functions for hot unplug test/amdgpu/hotunplug: Add test suite for GPU unplug test/amdgpu/hotunplug: Add basic test tests/amdgpu/hotunplug: Add unplug with cs test. tests/amdgpu/hotunplug: Add hotunplug with exported bo testQuoted 4 lines
Given how nasty hotunplug is I really think collaborating on igt tests on this would be best for everyone ... do we have to keep doing parallel tests here for amdgpu?
-DanielAFAIK as far as AMD goes a lot of developers use libdrm for regression testing
while developing their features and also QA as i can see from some internal ticket
specifically opened for failing to pass libdrm tests. From my bitter experience with
GPU reset - features which are not part of a common use case such as device loading,
mode setting or commands submissions tend to very quickly break as people develop
features but never test them in those uncommon use cases - this is why I feel it will be
very helpful to include those tests in libdrm.Also given that this is libdrm amdgpu code it fits naturally into libdrm.
Regarding IGT - as you may remember I have them there too -
https://gitlab.freedesktop.org/agrodzov/igt-gpu-tools/-/commits/master
I hit some compile breakage on debian platform there which i need to resolve before i will submit for review there too.
Quoted 6 lines
Why can't amd run the igt tests? Afaiui on the display side this is happening already, at least sometimes.
And yes regression tests matter, it just feels silly that we need to have them 2x for amdgpu. For old stuff the old repo is all fine, but for new feature it looks a bit silly.
Different teams, different CI infrastructures... It ends up being easier to port tests between frameworks than to switch frameworks in some cases.
Alex
Quoted 23 lines
-Daniel
Quoted 16 lines
Quoted 16 lines
Andrey
Quoted 12 lines
Quoted 12 lines
tests/amdgpu/amdgpu_test.c | 42 +++- tests/amdgpu/amdgpu_test.h | 26 +++ tests/amdgpu/basic_tests.c | 5 +- tests/amdgpu/hotunplug_tests.c | 357 +++++++++++++++++++++++++++++++++ tests/amdgpu/meson.build | 1 + xf86drm.c | 23 +++ xf86drm.h | 1 + 7 files changed, 450 insertions(+), 5 deletions(-)create mode 100644
tests/amdgpu/hotunplug_tests.cQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
--
2.25.1
Quoted 4 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Please open a gitlab MR for these.
Alex
Quoted 31 lines · Andrey Grodzovsky
Adding some tests to acompany the recently added hot-unplug feature. For now the test suite is disabled until the feature propagates from drm-misc-next to drm-next.
Andrey Grodzovsky (7):
tests/amdgpu: Fix valgrind warning
xf86drm: Add function to retrieve char device path test/amdgpu: Add helper functions for hot unplug test/amdgpu/hotunplug: Add test suite for GPU unplug test/amdgpu/hotunplug: Add basic test tests/amdgpu/hotunplug: Add unplug with cs test. tests/amdgpu/hotunplug: Add hotunplug with exported bo testtests/amdgpu/amdgpu_test.c | 42 +++- tests/amdgpu/amdgpu_test.h | 26 +++ tests/amdgpu/basic_tests.c | 5 +- tests/amdgpu/hotunplug_tests.c | 357 +++++++++++++++++++++++++++++++++ tests/amdgpu/meson.build | 1 + xf86drm.c | 23 +++ xf86drm.h | 1 + 7 files changed, 450 insertions(+), 5 deletions(-) create mode 100644 tests/amdgpu/hotunplug_tests.c--
2.25.1_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 0/7] libdrm tests for hot-unplug fe goature
Is libdrm on gitlab ? I wasn't aware of this. I assumed code reviews still go through dri-devel.
Andrey
________________________________
From: Alex Deucher <[email protected]>
Sent: 03 June 2021 17:20
To: Grodzovsky, Andrey <[email protected]>
Cc: Maling list - DRI developers <[email protected]>; amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>; Christian König <[email protected]>
Subject: Re: [PATCH 0/7] libdrm tests for hot-unplug feature
Please open a gitlab MR for these.
Alex
Quoted 24 lines · Andrey Grodzovsky
Adding some tests to acompany the recently added hot-unplug feature. For now the test suite is disabled until the feature propagates from drm-misc-next to drm-next.
Andrey Grodzovsky (7):
tests/amdgpu: Fix valgrind warning
xf86drm: Add function to retrieve char device path test/amdgpu: Add helper functions for hot unplug test/amdgpu/hotunplug: Add test suite for GPU unplug test/amdgpu/hotunplug: Add basic test tests/amdgpu/hotunplug: Add unplug with cs test. tests/amdgpu/hotunplug: Add hotunplug with exported bo testtests/amdgpu/amdgpu_test.c | 42 +++- tests/amdgpu/amdgpu_test.h | 26 +++ tests/amdgpu/basic_tests.c | 5 +- tests/amdgpu/hotunplug_tests.c | 357 +++++++++++++++++++++++++++++++++ tests/amdgpu/meson.build | 1 + xf86drm.c | 23 +++ xf86drm.h | 1 + 7 files changed, 450 insertions(+), 5 deletions(-) create mode 100644 tests/amdgpu/hotunplug_tests.c
Quoted 7 lines
--
2.25.1_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C8fb7f614798b4d19572e08d926d57530%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637583520507282588%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ozqlNQACGvLJugQ2GNvFl8CKgAH0thqMRpWjHpURlyc%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 0/7] libdrm tests for hot-unplug fe goature
Code review happens on gitlab now for libdrm.
Alex
Quoted 12 lines · Andrey
Is libdrm on gitlab ? I wasn't aware of this. I assumed code reviews still go through dri-devel.
Andrey
________________________________
From: Alex Deucher <[email protected]>
Sent: 03 June 2021 17:20
To: Grodzovsky, Andrey <[email protected]>
Cc: Maling list - DRI developers <[email protected]>; amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>; Christian König <[email protected]>
Subject: Re: [PATCH 0/7] libdrm tests for hot-unplug feature
Quoted 37 lines
Please open a gitlab MR for these.
Alex
Quoted 31 lines · Andrey Grodzovsky
Adding some tests to acompany the recently added hot-unplug feature. For now the test suite is disabled until the feature propagates from drm-misc-next to drm-next.
Andrey Grodzovsky (7):
tests/amdgpu: Fix valgrind warning
xf86drm: Add function to retrieve char device path test/amdgpu: Add helper functions for hot unplug test/amdgpu/hotunplug: Add test suite for GPU unplug test/amdgpu/hotunplug: Add basic test tests/amdgpu/hotunplug: Add unplug with cs test. tests/amdgpu/hotunplug: Add hotunplug with exported bo testtests/amdgpu/amdgpu_test.c | 42 +++- tests/amdgpu/amdgpu_test.h | 26 +++ tests/amdgpu/basic_tests.c | 5 +- tests/amdgpu/hotunplug_tests.c | 357 +++++++++++++++++++++++++++++++++ tests/amdgpu/meson.build | 1 + xf86drm.c | 23 +++ xf86drm.h | 1 + 7 files changed, 450 insertions(+), 5 deletions(-) create mode 100644 tests/amdgpu/hotunplug_tests.c--
2.25.1_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C8fb7f614798b4d19572e08d926d57530%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637583520507282588%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ozqlNQACGvLJugQ2GNvFl8CKgAH0thqMRpWjHpURlyc%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 0/7] libdrm tests for hot-unplug fe goature
Hey, MR created at https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/172, please help review.
Andrey
Quoted 53 lines · Alex Deucher
Code review happens on gitlab now for libdrm.
Alex
Quoted 47 lines · Andrey
Is libdrm on gitlab ? I wasn't aware of this. I assumed code reviews still go through dri-devel.
Andrey
________________________________
From: Alex Deucher <[email protected]>
Sent: 03 June 2021 17:20
To: Grodzovsky, Andrey <[email protected]>
Cc: Maling list - DRI developers <[email protected]>; amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>; Christian König <[email protected]>
Subject: Re: [PATCH 0/7] libdrm tests for hot-unplug featurePlease open a gitlab MR for these.
Alex
Quoted 30 lines · Andrey Grodzovsky
Adding some tests to acompany the recently added hot-unplug feature. For now the test suite is disabled until the feature propagates from drm-misc-next to drm-next.
Andrey Grodzovsky (7):
tests/amdgpu: Fix valgrind warning
xf86drm: Add function to retrieve char device path test/amdgpu: Add helper functions for hot unplug test/amdgpu/hotunplug: Add test suite for GPU unplug test/amdgpu/hotunplug: Add basic test tests/amdgpu/hotunplug: Add unplug with cs test. tests/amdgpu/hotunplug: Add hotunplug with exported bo testtests/amdgpu/amdgpu_test.c | 42 +++- tests/amdgpu/amdgpu_test.h | 26 +++ tests/amdgpu/basic_tests.c | 5 +- tests/amdgpu/hotunplug_tests.c | 357 +++++++++++++++++++++++++++++++++ tests/amdgpu/meson.build | 1 + xf86drm.c | 23 +++ xf86drm.h | 1 + 7 files changed, 450 insertions(+), 5 deletions(-)create mode 100644
tests/amdgpu/hotunplug_tests.c--
2.25.1_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CAndrey.Grodzovsky%40amd.com%7C155b8cb8d6834e86275a08d927004117%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637583704326965590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=AclAYkIS4xlE6cpmmaMyIo86gJ70Pk%2FkqJncGNAM3cw%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 3 lines · Alex Deucher
Please open a gitlab MR for these.
I'd really prefer these tests all get migrated out of here into igt. I don't think libdrm_amdgpu really should have tests that test the kernel level infrastructure.
I know some people at AMD had issues in the past with igt because the i might have stood for intel back in time, but at this point I think we should be moving past that.
Dave.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 10 lines · Dave Airlie
Quoted 3 lines · Alex Deucher
Please open a gitlab MR for these.
I'd really prefer these tests all get migrated out of here into igt. I don't think
libdrm_amdgpureally should have tests that test the kernel level infrastructure.
We are providing equivalent patches for IGT as well. There are some teams and customers that would prefer to stick with libdrm_amdgpu.
Quoted 3 lines
I know some people at AMD had issues in the past with igt because the i might have stood for intel back in time, but at this point I think we should be moving past that.
I don't think that was ever an issue. It's more that some teams built a bunch of infrastructure that used libdrm tests and haven't had the resources to switch to IGT yet.
Alex
Quoted 8 lines · Alex Deucher
Quoted 7 lines · Dave Airlie
Quoted 2 lines · Alex Deucher
Please open a gitlab MR for these.
I'd really prefer these tests all get migrated out of here into igt. I don't think
libdrm_amdgpureally should have tests that test the kernel level infrastructure.
I am also a bit confused now what's the policy about libdrm - is it being slowly deprecated ?
What tests should go to IGT and what to libdrm ?
The kernel feature itself is strictly amdgpu specific and not generic DRM level feature - why then it's not a good fit for amdgpu tester ?
Quoted 2 lines
We are providing equivalent patches for IGT as well. There are some teams and customers that would prefer to stick with
libdrm_amdgpu.
Here are the patches in my cloned gitlab repo - https://gitlab.freedesktop.org/agrodzov/igt-gpu-tools/-/commits/master
and I sent today for review to [email protected] too.
Andrey
Quoted 9 lines
Quoted 4 lines
I know some people at AMD had issues in the past with igt because the i might have stood for intel back in time, but at this point I think we should be moving past that.
I don't think that was ever an issue. It's more that some teams built a bunch of infrastructure that used libdrm tests and haven't had the resources to switch to IGT yet.
Alex