Commit e3ad0fbd authored by Milan Jaros's avatar Milan Jaros
Browse files

add new addons, fix ultragrid buffer

parent 6327770a
......@@ -290,11 +290,11 @@ endif()
if(WITH_NVPIPE)
set(NVPIPE_INCLUDE_DIR "" CACHE PATH "")
set(NVPIPE_LIBRARIES "" CACHE FILEPATH "")
find_package(CUDA REQUIRED)
#find_package(CUDA REQUIRED)
# Construct path to CUDA driver API lib (not provided by FindCUDA)
get_filename_component(CUDA_LIB_DIR ${CUDA_cudart_static_LIBRARY} DIRECTORY)
find_library(CUDA_LIB NAMES cuda HINTS ${CUDA_LIB_DIR})
#get_filename_component(CUDA_LIB_DIR ${CUDA_cudart_static_LIBRARY} DIRECTORY)
#find_library(CUDA_LIB NAMES cuda HINTS ${CUDA_LIB_DIR})
endif()
# Subdirectories
......
......@@ -89,7 +89,8 @@ if(WITH_CLIENT_ULTRAGRID_LIB)
endif()
if(WITH_NVPIPE)
target_link_libraries(blender_client${CLIENT_SUFFIX} ${NVPIPE_LIBRARIES} ${CUDA_LIBRARIES} ${CUDA_LIB})
#${CUDA_LIBRARIES} ${CUDA_LIB}
target_link_libraries(blender_client${CLIENT_SUFFIX} ${NVPIPE_LIBRARIES} ${CUDA_CUSTOM_LIBRARIES})
endif()
install (TARGETS blender_client${CLIENT_SUFFIX} DESTINATION bin)
This diff is collapsed.
......@@ -160,6 +160,7 @@ void cuda_free_kg(int numDevice, DEVICE_PTR kg);
void cuda_host_register(const char *name, char* mem, size_t memSize);
char *cuda_host_alloc(const char *name, DEVICE_PTR mem, size_t memSize, int type = 0); //1-managed, 2-pinned
void cuda_host_free(const char *name, DEVICE_PTR mem, char *dmem, int type = 0);//1-managed, 2-pinned
DEVICE_PTR cuda_get_host_get_device_pointer(char* mem);
DEVICE_PTR cuda_mem_alloc(
int numDevice, const char *name, char *mem, size_t memSize, bool spec_setts = true);
......
......@@ -1102,6 +1102,13 @@ void cuda_host_register(const char *name, char* mem, size_t memSize)
//}
}
DEVICE_PTR cuda_get_host_get_device_pointer(char *mem) {
CU_DEVICE_PTR dev_p;
cuda_assert(cudaHostGetDevicePointer(&dev_p, mem, 0));
return (DEVICE_PTR)dev_p;
}
char *cuda_host_alloc(const char *name, DEVICE_PTR mem, size_t memSize, int type) //1-managed, 2-pinned
{
//# ifdef WITH_CLIENT_UNIMEM
......@@ -3324,18 +3331,24 @@ void cuda_path_trace_internal(int numDevice,
// char *pixels_node1 = ((char **)map_pixel_bin)[0];
// char *pixels_node2 = ((char **)map_pixel_bin)[1];
//#else
char *pixels_node1 = (char *)map_pixel_bin;
char *pixels_node2 = (char *)map_pixel_bin + w * h * SIZE_UCHAR4;
//char *pixels_node1 = (char *)map_pixel_bin;
//char *pixels_node2 = (char *)map_pixel_bin + pix_size;
//#endif
int *pix_state = (int *)signal_value;
//#if defined(WITH_CLIENT_ULTRAGRID)
// //pixels_node2 = (char *)pixels_node2 + pix_size;
// stride *= 2;
//#endif
#if defined(WITH_CLIENT_RENDERENGINE_VR) || (defined(WITH_CLIENT_ULTRAGRID) && !defined(WITH_CLIENT_RENDERENGINE))
//pixels_node2 = (char *)pixels_node2 + w * h * SIZE_UCHAR4;
//pixels_node2 = (char *)pixels_node2 + pix_size;
int devices_left_eye = devices_size / 2;
if (devices_left_eye < 1)
devices_left_eye = 1;
//devices_left_eye = 0;
//devices_left_eye = 0;
int devices_right_eye = devices_size - devices_left_eye;
if (devices_right_eye < 1)
......@@ -3364,6 +3377,9 @@ void cuda_path_trace_internal(int numDevice,
// cuda_assert(cudaHostGetDevicePointer(&dev_pixels_node2, pixels_node2, 0));
//#else
char* pixels_node1 = (char*)map_pixel_bin;
char* pixels_node2 = (char*)map_pixel_bin + pix_size;
#ifdef WITH_CUDA_BUFFER_MANAGED
CU_DEVICE_PTR dev_pixels_node1 = (CU_DEVICE_PTR)pixels_node1;
CU_DEVICE_PTR dev_pixels_node2 = (CU_DEVICE_PTR)pixels_node2;
......@@ -3373,14 +3389,20 @@ void cuda_path_trace_internal(int numDevice,
//log_alloc(id, pix_size, "dev_pixels_node1");
cuda_assert(cudaHostGetDevicePointer(&dev_pixels_node1, pixels_node1, 0));
CU_DEVICE_PTR dev_pixels_node2; // omp_mem_alloc(DEVICE_ID, "pixels2", NULL, pix_size);
//cuda_assert(cudaMalloc(&dev_pixels_node2, pix_size));
//log_alloc(id, pix_size, "dev_pixels_node2");
cuda_assert(cudaHostGetDevicePointer(&dev_pixels_node2, pixels_node2, 0));
//CU_DEVICE_PTR dev_pixels_node2; // omp_mem_alloc(DEVICE_ID, "pixels2", NULL, pix_size);
////cuda_assert(cudaMalloc(&dev_pixels_node2, pix_size));
////log_alloc(id, pix_size, "dev_pixels_node2");
//cuda_assert(cudaHostGetDevicePointer(&dev_pixels_node2, pixels_node2, 0));
CU_DEVICE_PTR dev_pixels_node2 = (CU_DEVICE_PTR)((char*)dev_pixels_node1 + pix_size);
//#endif
#endif
#if defined(WITH_CLIENT_RENDERENGINE_VR) || (defined(WITH_CLIENT_ULTRAGRID) && !defined(WITH_CLIENT_RENDERENGINE))
pixels_node2 = (char *)pixels_node2 + pix_size;
dev_pixels_node2 = (char*)dev_pixels_node2 + pix_size;
#endif
# ifdef WITH_OPTIX_DENOISER
CU_DEVICE_PTR
dev_pixels_node1_denoised; // omp_mem_alloc(DEVICE_ID, "pixels1", NULL, pix_size);
......@@ -3433,9 +3455,15 @@ void cuda_path_trace_internal(int numDevice,
wtile.x = tile_x;
wtile.w = tile_w;
wtile.offset = offset;
wtile.stride = stride;
#ifdef WITH_CLIENT_ULTRAGRID
wtile.stride*=2;
if (id < devices_left_eye) {
}else{
wtile.offset = wtile.w;
}
#endif
wtile.buffer = (map_buffer_bin != 0) ?
(float *)scope.get().cuda_mem_map[map_buffer_bin].device_pointer :
0;
......@@ -3527,17 +3555,28 @@ void cuda_path_trace_internal(int numDevice,
dev_buffer = (map_buffer_bin != 0) ?
(float *)scope.get().cuda_mem_map[map_buffer_bin].device_pointer :
0;
#ifdef WITH_CLIENT_ULTRAGRID
dev_buffer_size = scope.get().cuda_mem_map[map_buffer_bin].size;
#else
dev_buffer_size = scope.get().cuda_mem_map[map_buffer_bin].size / 2;
#endif
cuda_const_copy_internal("__data", &cuda_kernel_data[0], cuda_kernel_data.size(), scope);
}
else {
// dev_buffer_size = scope.get().cuda_mem_map[map_buffer_bin].size / 2;
#ifdef WITH_CLIENT_ULTRAGRID
dev_buffer = (map_buffer_bin != 0) ?
(float *)scope.get().cuda_mem_map[map_buffer_bin].device_pointer :
0;
dev_buffer_size = scope.get().cuda_mem_map[map_buffer_bin].size;
#else
dev_buffer = (float *)((char *)scope.get().cuda_mem_map[map_buffer_bin].device_pointer +
scope.get().cuda_mem_map[map_buffer_bin].size / 2);
dev_buffer_size = scope.get().cuda_mem_map[map_buffer_bin].size / 2;
#endif
// dev_buffer = (map_buffer_bin != 0) ?
// (float *)scope.get().cuda_mem_map[map_buffer_bin].device_pointer :
// 0;
......@@ -3696,12 +3735,13 @@ void cuda_path_trace_internal(int numDevice,
//# endif
/////////////////////////////////////////////////////////////////////////////////////////////
#if defined(WITH_CLIENT_RENDERENGINE_VR) || (defined(WITH_CLIENT_ULTRAGRID) && !defined(WITH_CLIENT_RENDERENGINE))
#if defined(WITH_CLIENT_RENDERENGINE_VR) //|| (defined(WITH_CLIENT_ULTRAGRID) && !defined(WITH_CLIENT_RENDERENGINE))
if (id < devices_left_eye) {
// pixels_node = pixels_node;
}
else {
pixels_node = (char *)pixels_node + w * h * pix_type_size;
pixels_node = (char *)pixels_node + pix_size;
dev_pixels_node = (DEVICE_PTR)((char*)dev_pixels_node + pix_size);
}
# endif
/////////////////////////////////////////////////////////////////////////////////////////////
......@@ -3757,10 +3797,10 @@ void cuda_path_trace_internal(int numDevice,
double t_id2 = omp_get_wtime();
#ifndef WITH_CUDA_BUFFER_MANAGED
// transfer to CPU
cuda_assert(cudaEventRecord(event_memcpy_start, stream_path));
#endif
//#ifndef WITH_CUDA_BUFFER_MANAGED
// // transfer to CPU
// cuda_assert(cudaEventRecord(event_memcpy_start, stream_path));
//#endif
# ifdef WITH_OPTIX_DENOISER
// cuda_assert(cudaMemcpy((char *)pixels_node + id*sizeof(float),
......@@ -3883,13 +3923,13 @@ void cuda_path_trace_internal(int numDevice,
//}
//# else
//# ifndef WITH_CLIENT_ULTRAGRID
#ifndef WITH_CUDA_BUFFER_MANAGED
cuda_assert(cudaMemcpyAsync((char *)pixels_node + pix_offset,
(char *)dev_pixels_node + pix_offset,
total_work_size * pix_type_size,
cudaMemcpyDeviceToHost,
stream_path));
#endif
//#ifndef WITH_CUDA_BUFFER_MANAGED
// cuda_assert(cudaMemcpyAsync((char *)pixels_node + pix_offset,
// (char *)dev_pixels_node + pix_offset,
// total_work_size * pix_type_size,
// cudaMemcpyDeviceToHost,
// stream_path));
//#endif
//# endif
# endif
......@@ -3919,12 +3959,12 @@ void cuda_path_trace_internal(int numDevice,
# endif
#ifndef WITH_CUDA_BUFFER_MANAGED
cuda_assert(cudaEventRecord(event_memcpy_stop, stream_path));
// cuda_assert(cudaDeviceSynchronize());
cuda_assert(cudaEventSynchronize(event_memcpy_stop));
cuda_assert(cudaEventElapsedTime(time_memcpy, event_memcpy_start, event_memcpy_stop));
#endif
//#ifndef WITH_CUDA_BUFFER_MANAGED
// cuda_assert(cudaEventRecord(event_memcpy_stop, stream_path));
// // cuda_assert(cudaDeviceSynchronize());
// cuda_assert(cudaEventSynchronize(event_memcpy_stop));
// cuda_assert(cudaEventElapsedTime(time_memcpy, event_memcpy_start, event_memcpy_stop));
//#endif
# ifdef WITH_OPTIX_DENOISER2
unsigned char *up = (unsigned char *)((char *)pixels_node);
......@@ -4099,7 +4139,12 @@ void cuda_path_trace_internal(int numDevice,
}
}
# else
for (int id1 = 0; id1 < devices_size - 1; id1++) {
#ifdef WITH_CLIENT_ULTRAGRID
if (id1==devices_left_eye-1)
continue;
#endif
float time1 = 0;
float time2 = 0;
if (dev_pixels_node == (DEVICE_PTR)dev_pixels_node1) {
......@@ -4241,12 +4286,12 @@ void cuda_path_trace_internal(int numDevice,
// omp_mem_free(DEVICE_ID, dev_pixels_node1, pix_size);
// omp_mem_free(DEVICE_ID, dev_pixels_node2, pix_size);
#ifndef WITH_CUDA_BUFFER_MANAGED
//cuda_assert(cudaFree((CU_DEVICE_PTR)dev_pixels_node1));
//log_free(id, pix_size, "dev_pixels_node1");
//cuda_assert(cudaFree((CU_DEVICE_PTR)dev_pixels_node2));
//log_free(id, pix_size, "dev_pixels_node2");
#endif
//#ifndef WITH_CUDA_BUFFER_MANAGED
// //cuda_assert(cudaFree((CU_DEVICE_PTR)dev_pixels_node1));
// //log_free(id, pix_size, "dev_pixels_node1");
// //cuda_assert(cudaFree((CU_DEVICE_PTR)dev_pixels_node2));
// //log_free(id, pix_size, "dev_pixels_node2");
//#endif
}
# ifdef WITH_OPTIX_DENOISER2
......@@ -6582,6 +6627,9 @@ void cuda_socket_step(int numDevice, DEVICE_PTR kg_bin, char *data_bin, char *cd
#if defined(WITH_CLIENT_RENDERENGINE_VR) || (defined(WITH_CLIENT_ULTRAGRID) && !defined(WITH_CLIENT_RENDERENGINE))
view_to_kernel_camera_right(&cuda_kernel_data_right[0], (cyclesphi_data *)cdata);
//# else
// cuda_const_copy(
// numDevice, kg_bin, "__data", &cuda_kernel_data[0], cuda_get_size_data(kg_bin), false);
# endif
# else
......@@ -6641,12 +6689,13 @@ void cuda_socket_step(int numDevice, DEVICE_PTR kg_bin, char *data_bin, char *cd
rastertocamera[10] *= old_new_width;
// rastertocamera[11] *= old_new_width;
cuda_const_copy(
numDevice, kg_bin, "__data", &cuda_kernel_data[0], cuda_get_size_data(kg_bin), false);
# endif
// apply data
memcpy(data_bin, &cuda_kernel_data[0], cuda_get_size_data(kg_bin));
cuda_const_copy(
numDevice, kg_bin, "__data", &cuda_kernel_data[0], cuda_get_size_data(kg_bin), false);
}
// void cuda_socket_step(
......
......@@ -353,9 +353,9 @@ endif()
)
endif()
if(WITH_CLIENT_ULTRAGRID)
if(WITH_CLIENT_YUV)
list(APPEND cuda_flags
-DWITH_CLIENT_ULTRAGRID
-DWITH_CLIENT_YUV
)
endif()
......
......@@ -76,7 +76,8 @@ include_directories(${INC})
add_library(cyclesphi_renderengine SHARED ${SRC} ${SRC_HEADERS})
if(WITH_NVPIPE)
target_link_libraries(cyclesphi_renderengine ${NVPIPE_LIBRARIES} ${CUDA_LIBRARIES} ${CUDA_LIB})
#${CUDA_LIBRARIES} ${CUDA_LIB}
target_link_libraries(cyclesphi_renderengine ${NVPIPE_LIBRARIES} ${CUDA_CUSTOM_LIBRARIES})
endif()
install (TARGETS cyclesphi_renderengine DESTINATION lib)
......@@ -47,7 +47,7 @@ ug_sender *g_ug_sender = NULL;
using std::atomic_bool;
using std::atomic_int;
static void convert_render_pkt_to_view_matrix(struct RenderPacket *pkt,
void convert_render_pkt_to_view_matrix(struct RenderPacket *pkt,
cyclesphi::cyclesphi_data *cdata);
#ifdef RENDER_PACKET_FROM_FILE
......@@ -285,8 +285,8 @@ void cesnet_set_camera_data(cyclesphi::cyclesphi_data *cdata)
if (!g_cdata_init) {
// printf("get_camera_matrices\n");
g_cdata.step_samples = 1;
g_cdata.width = 7680 / 2;
g_cdata.height = 2160;
g_cdata.width = 7680 / 2 ;
g_cdata.height = 2160 ;
// g_cdata.width = 5120 / 2;
// g_cdata.height = 1440; //2116x1203
......@@ -366,7 +366,7 @@ void cesnet_set_camera_data(cyclesphi::cyclesphi_data *cdata)
if(env_p_port_cam)
g_init_params.rx_port = atoi(env_p_port_cam);
g_init_params.compression = UG_UNCOMPRESSED;
g_init_params.compression = UG_UNCOMPRESSED; //UG_JPEG
g_init_params.rprc = render_packet_received_callback;
g_init_params.rprc_udata = NULL; // not used by render_packet_received_callback()
......@@ -502,6 +502,10 @@ int cesnet_get_buffers(char** buf1, char** buf2) {
return MAX_BUF_LEN;
}
# if defined(WITH_BMP_OUTPUT)
int g_required_exit_num = 0;
# endif
// rendering buffer - results in RGBA format
int cesnet_set_render_buffer_rgba(unsigned char* rgba, int width, int height)
{
......@@ -509,8 +513,11 @@ int cesnet_set_render_buffer_rgba(unsigned char* rgba, int width, int height)
// printf("cesnet_set_render_buffer_rgba: %d %d %d %d\n", rgba[0], rgba[1], rgba[2], rgba[4]);
# if defined(WITH_BMP_OUTPUT)
save_bmp(rgba, width, height);
g_is_required_exit = true;
if (g_required_exit_num == 10) {
save_bmp(rgba, width, height);
g_is_required_exit = true;
}
g_required_exit_num++;
# endif
if (width == 0 || height == 0) {
......@@ -847,7 +854,7 @@ static void dump_render_pkt(struct RenderPacket *pkt)
pkt->frame);
}
static void convert_render_pkt_to_view_matrix(struct RenderPacket *pkt,
void convert_render_pkt_to_view_matrix(struct RenderPacket *pkt,
cyclesphi::cyclesphi_data *cdata)
{
#if 0
......
......@@ -14,6 +14,8 @@ set(INC
${CUDA_TOOLKIT_INCLUDE}
${CUDA_INCLUDE_DIRS}
${NVPIPE_INCLUDE_DIR}
)
set(SRC
......@@ -56,6 +58,10 @@ if(WITH_SIZE_UCHAR3)
add_definitions(-DWITH_SIZE_UCHAR3)
endif()
if(WITH_NVPIPE)
add_definitions(-DWITH_NVPIPE)
endif()
if(WITH_CUDA_GL_INTEROP)
add_definitions(-DWITH_CUDA_GL_INTEROP)
endif()
......@@ -80,7 +86,6 @@ add_definitions(
include_directories(${INC})
<<<<<<< HEAD
if(WITH_VRCLIENT_VRGSTREAM)
add_library(vrgstream STATIC ${SRC})
target_link_libraries(vrgstream glad ${GLFW_LIBRARIES})
......@@ -88,14 +93,6 @@ if(WITH_VRCLIENT_VRGSTREAM)
if(WITH_CUDA_GL_INTEROP)
target_link_libraries(vrgstream ${CUDA_CUSTOM_LIBRARIES})
endif()
=======
add_executable(vrclient ${SRC})
target_link_libraries(vrclient glad ${GLFW_LIBRARIES} ${OPENVR_LIBRARIES})
if(WITH_CUDA_GL_INTEROP)
target_link_libraries(vrclient ${CUDA_CUSTOM_LIBRARIES} ${CUDA_CUSTOM_LIBRARIES})
endif()
>>>>>>> a14bae17e5afdf12d27e4203d6fb157a0f641f6f
set_target_properties(vrgstream PROPERTIES PUBLIC_HEADER "../ultragrid/vrgstream.h")
......@@ -111,5 +108,14 @@ else()
target_link_libraries(vrclient ${CUDA_CUSTOM_LIBRARIES})
endif()
if(WITH_VRCLIENT_OPENVR)
# message("${OPENVR_LIBRARIES}")
target_link_libraries(vrclient ${OPENVR_LIBRARIES})
endif()
if(WITH_NVPIPE)
target_link_libraries(vrclient ${NVPIPE_LIBRARIES} ${CUDA_LIBRARIES} ${CUDA_LIB})
endif()
install (TARGETS vrclient DESTINATION bin)
endif()
This diff is collapsed.
......@@ -54,7 +54,7 @@
#else
# define TCP_BLK_SIZE (128L * 1024L)
#endif
#define SOCKET_CONNECTIONS 1
#define SOCKET_CONNECTIONS 4
// RGB
//#define TCP_WIN_SIZE_SEND (2L * 1024L * 1024L)
......@@ -71,7 +71,7 @@
# define KERNEL_SOCKET_RECV(s, buf, len) read(s, buf, len)
#endif
//#define PRINT_DEBUG
#define PRINT_DEBUG
//#ifndef WITH_CLIENT_VRGSTREAM
namespace cyclesphi {
......@@ -506,6 +506,12 @@ bool socket_client_create(const char *server_name,
# ifndef WITH_SOCKET_UDP
while (true) {
# ifdef _WIN32
Sleep(2);
# else
usleep(2000000);
# endif
int err_connect = connect(client_socket_id, (sockaddr *)&client_sock, sizeof(client_sock));
if (client_socket_id == -1) {
printf("disconnect\n");
......@@ -514,11 +520,11 @@ bool socket_client_create(const char *server_name,
if (err_connect == -1) {
printf("wait on server %s:%d\n", server_name, port);
# ifdef _WIN32
Sleep(2);
# else
usleep(2000000);
# endif
//# ifdef _WIN32
// Sleep(2);
//# else
// usleep(2000000);
//# endif
continue;
}
break;
......@@ -1159,7 +1165,11 @@ void socket_recv_data_cam(char *data, CLIENT_SIZE_T size, bool ack_enabled)
while (left > 0) {
# ifdef WITH_SOCKET_UDP
#ifdef _WIN32
int len = sizeof(g_client_sockaddr_cam[tid]);
#else
unsigned int len = sizeof(g_client_sockaddr_cam[tid]);
#endif
int temp = recvfrom(g_client_socket_id_cam[tid],
(char *)data + step_size * step + ss2,
left,
......@@ -1289,7 +1299,14 @@ void socket_recv_data_data(char *data, CLIENT_SIZE_T size, bool ack_enabled)
while (left > 0) {
# ifdef WITH_SOCKET_UDP
//unsigned int len = sizeof(g_client_sockaddr_data[tid]);
#ifdef _WIN32
int len = sizeof(g_client_sockaddr_data[tid]);
#else
unsigned int len = sizeof(g_client_sockaddr_data[tid]);
#endif
int temp = recvfrom(g_client_socket_id_data[tid],
(char *)data + step_size * step + ss2,
left,
......@@ -1520,8 +1537,9 @@ void nvpipe_decode_init(int width, int height)
void nvpipe_encode_init(int width, int height)
{
//NVPIPE_LOSSY
g_encoder = NvPipe_CreateEncoder(
NVPIPE_RGBA32, NVPIPE_H264, NVPIPE_LOSSY, 10 * 1000 * 1000, 60, width, height);
NVPIPE_RGBA32, NVPIPE_H264, NVPIPE_LOSSLESS, 100 * 1000 * 1000, 90, width, height);
}
int nvpipe_encode(DEVICE_PTR dmem, char *pixels, int width, int height)
......@@ -1532,14 +1550,14 @@ int nvpipe_encode(DEVICE_PTR dmem, char *pixels, int width, int height)
uint64_t size = NvPipe_Encode(g_encoder,
(char *)dmem,
width * 4,
(uint8_t *)pixels + sizeof(int),
width * height * 4 - sizeof(int),
(uint8_t *)pixels/* + sizeof(int)*/,
width * height * 4 /*- sizeof(int)*/,
width,
height,
false);
int *s = (int *)pixels;
s[0] = size;
//int *s = (int *)pixels;
//s[0] = size;
if (size == 0)
printf("%s\n", NvPipe_GetError(g_encoder));
......@@ -1562,11 +1580,13 @@ void nvpipe_decode(char *dmem, char *pixels, int frame_size, int width, int heig
void socket_send_nvpipe(DEVICE_PTR dmem, char *pixels, int width, int height)
{
# ifdef WITH_NVPIPE
double t0 = omp_get_wtime();
int frame_size = nvpipe_encode(dmem, &pixels[0], width, height);
// socket_send_data_data((char *)&frame_size, sizeof(int));
socket_send_data_data((char *)pixels, sizeof(int) + frame_size);
double t1 = omp_get_wtime();
socket_send_data_data((char *)&frame_size, sizeof(int), false);
socket_send_data_data((char *)pixels, frame_size);
double t2 = omp_get_wtime();
printf("socket_send_nvpipe: %f, %f\n", t1-t0, t2-t1);
// char ack = 0;
// socket_recv_data_data((char *)&ack, sizeof(char));
# endif
......@@ -1576,10 +1596,13 @@ void socket_recv_nvpipe(char *dmem, char *pixels, int width, int height)
{
# ifdef WITH_NVPIPE
int frame_size = 0;
socket_recv_data_data((char *)&frame_size, sizeof(int));
double t0 = omp_get_wtime();
socket_recv_data_data((char *)&frame_size, sizeof(int), false);
socket_recv_data_data((char *)dmem, frame_size);
double t1 = omp_get_wtime();
nvpipe_decode(dmem, pixels, frame_size, width, height);
double t2 = omp_get_wtime();
printf("socket_recv_nvpipe: %f, %f\n", t1 - t0, t2 - t1);
# endif
}
......
......@@ -110,20 +110,20 @@ CUDA_LAUNCH_BOUNDS(CUDA_THREADS_BLOCK_WIDTH, CUDA_KERNEL_MAX_REGISTERS)
if(pixel != NULL) {
//#if defined(WITH_CLIENT_ULTRAGRID)
// kernel_film_convert_to_byte_i420(NULL,
// (uchar *)pixel,
// (float *)buffer,
// 1.0f / end_sample,
// x,
// y,
// tile->offset,
// tile->stride,
// tile->x,
// tile_y,
// tile_h,
// tile->w);
//#else
#if defined(WITH_CLIENT_YUV)
kernel_film_convert_to_byte_i420(NULL,
(uchar *)pixel,
(float *)buffer,
1.0f / end_sample,
x,
y,
tile->offset,
tile->stride,
tile->x,
tile_y,
tile_h,
tile->w);
#else
#ifdef WITH_OPTIX_DENOISER
kernel_film_convert_to_float(NULL,
......@@ -147,7 +147,7 @@ CUDA_LAUNCH_BOUNDS(CUDA_THREADS_BLOCK_WIDTH, CUDA_KERNEL_MAX_REGISTERS)
#endif
//#endif
#endif
}
}
}
......