A Modern GPGPU API & wip linux RDNA2+ Driver
rdna driver linux gpu
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fixed hello_queue: now working

+17 -1
+2
CMakeLists.txt
··· 4 4 LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") 5 5 LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/sanitizers") 6 6 7 + find_package(Sanitizers) 8 + 7 9 add_subdirectory(vendor) 8 10 add_subdirectory(libvektor)
+4
libvektor/CMakeLists.txt
··· 24 24 fmt::fmt 25 25 ) 26 26 27 + add_sanitizers(vektor) 28 + 27 29 file(GLOB TEST_DIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/test ${CMAKE_CURRENT_SOURCE_DIR}/test/*) 28 30 29 31 foreach(test_dir ${TEST_DIRS}) ··· 41 43 42 44 # 4. Link your library (libvektor) 43 45 target_link_libraries(${test_name} PRIVATE vektor) 46 + 47 + add_sanitizers(${test_name}) 44 48 45 49 message(STATUS "Added test: ${test_name}") 46 50 endif()
+2 -1
libvektor/src/amdgpu/cmdstream.cpp
··· 23 23 amdgpu_bo_cpu_map(m_bo_handle, &ptr); 24 24 m_cpu_map = static_cast<uint32_t*>(ptr); 25 25 26 - amdgpu_va_range_alloc(m_dev, amdgpu_gpu_va_range_general, m_cfg.ring_size_bytes, 1, 0, &m_gpu_va, nullptr, 0); 26 + amdgpu_va_handle va_handle; 27 + amdgpu_va_range_alloc(m_dev, amdgpu_gpu_va_range_general, m_cfg.ring_size_bytes, 1, 0, &m_gpu_va, &va_handle, 0); 27 28 amdgpu_bo_va_op(m_bo_handle, 0, m_cfg.ring_size_bytes, m_gpu_va, AMDGPU_VM_PAGE_READABLE, AMDGPU_VA_OP_MAP); 28 29 } 29 30
+6
libvektor/src/vektor_queue.cpp
··· 54 54 assert(cl->queue == queue, "submit: commandlist from foreign queue"); 55 55 56 56 queue->cmd_ring->submit(cl->cs); 57 + 58 + // @todo: to free commandlist, we want to be sure that it is no longer mapped and stuff. 59 + // then, we can freely-free it. But i think this needs some deferred-cleanup, as 60 + // the data is on GTT so we cannot just let the CPU start using the range again. 61 + // 62 + // think about this. 57 63 } 58 64 59 65 }
+3
libvektor/test/02_hello_queue/hello_queue.cpp
··· 23 23 vektor::submit(dma, l1); 24 24 25 25 // @todo: how to wait on cpu for DMA transfer? TODO? 26 + printf("x[0]: %u\n", ((uint32_t *)x.cpu)[0]); 27 + sleep(1); 28 + printf("x[0]: %u\n", ((uint32_t *)x.cpu)[0]); 26 29 27 30 vektor::free(dev, x); 28 31 vektor::destroy(dev);