Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvpipe_decode() segfaults #11

Closed
omaralvarez opened this issue Mar 2, 2018 · 17 comments
Closed

nvpipe_decode() segfaults #11

omaralvarez opened this issue Mar 2, 2018 · 17 comments

Comments

@omaralvarez
Copy link
Contributor

omaralvarez commented Mar 2, 2018

I have compiled NvPipe with the following setup:

  • Release
  • Ubuntu 17.04 x64
  • GCC 6.3.0
  • Driver 390.25
  • Video Codec SDK 8.0
  • CUDA 9.1
  • GTX 1050

I have been testing a small client-server example, in which the server renders something which it is then encoded and sent to the client for decoding.

Everything seems to be working properly on the encoding side, but when I try to decode the result:

nvp_err_t decodeStatus = nvpipe_decode(decoder, clientReceiveBuffer, numBytes, clientDeviceBuffer, width, height, NVPIPE_RGBA);

I get the following segfault:

[1]    23652 segmentation fault (core dumped)  ./zero-latency-client

Any advice on how to fix this?

@omaralvarez
Copy link
Contributor Author

omaralvarez commented Mar 2, 2018

After further investigation the offending lines are decode.c (275-278):

if(cuvidCreateVideoParser(&nvp->parser, &prs) != CUDA_SUCCESS) {
        ERR(dec, "failed creating video parser.");
        return NVPIPE_EDECODE;
}

@tfogal
Copy link
Contributor

tfogal commented Mar 2, 2018

Please compile in debug mode and copy-paste the output of a "bt full" (from gdb) here.

@omaralvarez
Copy link
Contributor Author

omaralvarez commented Mar 5, 2018

Thanks for the quick response, here it goes:

Thread 1 "zero-latency-cl" received signal SIGSEGV, Segmentation fault.
0x00007ffff7bc9362 in initialize_parser (nvp=0x555555dd4700) at .../NvPipe/decode.c:275
275         if(cuvidCreateVideoParser(&nvp->parser, &prs) != CUDA_SUCCESS) {
(gdb) bt full
#0  0x00007ffff7bc9362 in initialize_parser (nvp=0x555555dd4700) at ..../NvPipe/decode.c:275
        prs = {CodecType = cudaVideoCodec_H264, ulMaxNumDecodeSurfaces = 2, ulClockRate = 0, ulErrorThreshold = 100, ulMaxDisplayDelay = 0, uReserved1 = {0, 0, 0, 0, 0},
          pUserData = 0x555555dd4700, pfnSequenceCallback = 0x7ffff7bc8fdb <dec_sequence>, pfnDecodePicture = 0x7ffff7bc91bc <dec_ode>,
          pfnDisplayPicture = 0x7ffff7bc9269 <dec_display>, pvReserved2 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, pExtVideoInfo = 0x0}
        __FUNCTION__ = "initialize_parser"
#1  0x00007ffff7bc9884 in nvp_cuvid_decode (cdc=0x555555dd4700, ibuf=0x7fffd9016010, ibuf_sz=8294400, obuf=0x7fffd9800000, width=1920, height=1080, format=NVPIPE_RGBA)
    at ..../NvPipe/decode.c:391
        perr = 32767
        __FUNCTION__ = "nvp_cuvid_decode"
        nvp = 0x555555dd4700
        __PRETTY_FUNCTION__ = "nvp_cuvid_decode"
        components = 4
        widthUser = 4160506344
        heightUser = 32767
        widthDevice = 10
        heightDevice = 0
        pkt = {flags = 8294416, payload_size = 140737326740559, payload = 0x7e9000 <error: Cannot access memory at address 0x7e9000>, timestamp = 140737336035672}
        parse = 4136749824
        map = {progressive_frame = 8294400, second_field = 0, top_field_first = -9584, unpaired_field = 32767, reserved_flags = 0, reserved_zero = 0, raw_input_dptr = 0,
          raw_input_pitch = 4294957488, raw_input_format = 32767, raw_output_dptr = 140737351937460, raw_output_pitch = 5, Reserved1 = 0, output_stream = 0x0, Reserved = {5, 0,
            4132828576, 32767, 4294957056, 32767, 1440723744, 21845, 4136749824, 32767, 8294416, 0, 4136749912, 32767, 9999, 0, 8294416, 0, 4133354962, 32767, 126, 0, 8294400, 0,
            4294956976, 32767, 4294956975, 32767, 1969382756, 1919248231, 1635021889, 1684367459, 1644196468, 1801678700, 10321, 4294934528, 129600, 0, 518401, 129648, 16200, 0, 2025,
            0, 16291, 2135}, Reserved2 = {0xfd, 0x1f}}
        pitch = 32767
        data = 140737330137944
        mrs = 32767
        evt = 8294416
        evwait = cudaSuccess
        orgerr = 8298496
        maperr = CUDA_SUCCESS
#2  0x00007ffff7bcd4ae in nvpipe_decode (codec=0x555555dd4700, ibuf=0x7fffd9016010, ibuf_sz=8294400, obuf=0x7fffd9800000, width=1920, height=1080, format=NVPIPE_RGBA)
    at ..../NvPipe/api.c:104
        __PRETTY_FUNCTION__ = "nvpipe_decode"
        dec = 0x555555dd4700
#3  0x000055555555b8b4 in main (argc=1, argv=0x7fffffffda98) at .../zero-latency/src/client.cpp:217
        display = 0x5555557e0510
        major = 1
        minor = 4
        configAttribs = {12339, 1, 12322, 8, 12323, 8, 12324, 8, 12325, 8, 12352, 8, 12344}
        numConfigs = 1
        config = 0xcaf34d
        width = 1920
        height = 1080
        pbufferAttribs = {12375, 1920, 12374, 1080, 12344}
        surface = 0x555555806d41
        context = 0x5555558065c1
        clientVertexShader = 0x5555555b2535 "#version 330\nvoid main() {}"
        clientGeometryShader = 0x5555555b2558 "#version 330 core\nlayout(points) in;layout(triangle_strip, max_vertices = 4) out;out vec2 texcoord;void main() {gl_Position = vec4( 1.0, 1.0, 0.0, 1.0 ); texcoord = vec2( 1.0, 1.0 ); EmitVertex();gl_P"...
        clientFragmentShader = 0x5555555b2730 "#version 330\nuniform sampler2D tex;in vec2 texcoord;out vec4 color;void main() {\tcolor = texture(tex, texcoord);}"
        clientVertexShaderHandle = 1
        clientGeometryShaderHandle = 2
        clientFragmentShaderHandle = 3
        clientFullscreenQuadProgram = 4
        clientFullscreenTextureLocation = 0
        clientFullscreenVAO = 1
        clientColorTex = 1
        clientGraphicsResource = 0x555555dd3120
        decoder = 0x555555dd4700
        clientDeviceBufferSize = 8294400
        clientDeviceBuffer = 0x7fffd9800000
        clientReceiveBufferSize = 8294400
        clientReceiveBuffer = 0x7fffd9016010 ""
        address = {sin_family = 12339, sin_port = 0, sin_addr = {s_addr = 1}, sin_zero = "\"0\000\000\b\000\000"}
        sock = 51
        serv_addr = {sin_family = 2, sin_port = 30755, sin_addr = {s_addr = 16777343}, sin_zero = "00000000"}
        nbuffer = 8294400
        imgsz = 8294400
        rgb = 0x7fffd882c010 ""
        numBytes = 8294400
        decodeStatus = 2760719407
        clientArray = 0x7ffff6ebd818 <std::wclog+216>

@tfogal
Copy link
Contributor

tfogal commented Mar 5, 2018

Looks like you're giving a device pointer to nvpipe_decode. Is that true? The API needs/accepts a host pointer.

@omaralvarez
Copy link
Contributor Author

I have tried with both and it crashes in the same place. I have also been looking at the NvPipe code and it looks like it works with both:

if(is_device_ptr(obuf)) {
        dstbuf = (CUdeviceptr)obuf;
}

There are several checks like that, so I assumed that it was capable of dealing with both. The included EGL example has the same problem in my system, so I assume it is not a problem with my code. I could paste the output of the trace with the host pointer, but it is exactly the same. It crashes for the cuvidCreateVideoParser() function.

@tfogal
Copy link
Contributor

tfogal commented Mar 6, 2018

Ahh. We need to update our doc comments, then :-). Will add that to my list, thanks.

The most plausible explanation is that you are linking against one version of cuvid and loading another. 'ldd' would help debug that.

A less plausible explanation is just some installation or setup problem with your cuvid setup. To test this, I would download the NVIDIA Video SDK and compile + run the samples, particularly the "decodeGL" one. If those fail then that rules out NVPipe.

Looking more closely at the backtrace, there's a couple things that are of interest. One is that your nvp_cuvid_decode stack has a lot of variables (widthUser etc.) that seem to be uninitialized (this is likely a debuginfo problem / red herring). The other is that you appear to be using OpenGL. There may be issues mixing/associating OGL and CUDA devices. It would be informative if you could reproduce this without OpenGL in the mix, i.e. with just a buffer you've created yourself.

@omaralvarez
Copy link
Contributor Author

The most plausible explanation is that you are linking against one version of cuvid and loading another. 'ldd' would help debug that.

        linux-vdso.so.1 =>  (0x00007fffe144e000)
        libnvpipe.so => /usr/local/lib/libnvpipe.so (0x00007f7d7873a000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7d784ed000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7d782e9000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7d780e1000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7d77d59000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7d77b40000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7d77779000)
        libcudart.so.9.1 => /usr/local/cuda-9.1/lib64/libcudart.so.9.1 (0x00007f7d7750b000)
        libnvToolsExt.so.1 => /usr/local/cuda-9.1/lib64/libnvToolsExt.so.1 (0x00007f7d77302000)
        libcuda.so.1 => /usr/lib/x86_64-linux-gnu/libcuda.so.1 (0x00007f7d76762000)
        libnvcuvid.so.1 => /usr/lib/x86_64-linux-gnu/libnvcuvid.so.1 (0x00007f7d76303000)
        /lib64/ld-linux-x86-64.so.2 (0x000055eb55cce000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7d75ff8000)
        libnvidia-fatbinaryloader.so.390.25 => /usr/lib/x86_64-linux-gnu/libnvidia-fatbinaryloader.so.390.25 (0x00007f7d75dac000)

        Version information:
        ./zero-latency-client:
                libgcc_s.so.1 (GCC_3.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1
                libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
                librt.so.1 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/librt.so.1
                libstdc++.so.6 (CXXABI_1.3) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.21) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
                libc.so.6 (GLIBC_2.3.3) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
                libpthread.so.0 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libpthread.so.0
                libpthread.so.0 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libpthread.so.0
                libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0
        /usr/local/lib/libnvpipe.so:
                libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
                libnvToolsExt.so.1 (libnvToolsExt.so.1) => /usr/local/cuda-9.1/lib64/libnvToolsExt.so.1
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
                libcudart.so.9.1 (libcudart.so.9.1) => /usr/local/cuda-9.1/lib64/libcudart.so.9.1
        /lib/x86_64-linux-gnu/libpthread.so.0:
                ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libdl.so.2:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/librt.so.1:
                libpthread.so.0 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libpthread.so.0
                libpthread.so.0 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libpthread.so.0
                libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0
                libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
        /usr/lib/x86_64-linux-gnu/libstdc++.so.6:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                libm.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libm.so.6
                libgcc_s.so.1 (GCC_4.2.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.3) => /lib/x86_64-linux-gnu/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.18) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.17) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libgcc_s.so.1:
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libc.so.6:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
        /usr/local/cuda-9.1/lib64/libcudart.so.9.1:
                libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
                librt.so.1 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/librt.so.1
                libpthread.so.0 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libpthread.so.0
                libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0
                libc.so.6 (GLIBC_2.3.3) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /usr/local/cuda-9.1/lib64/libnvToolsExt.so.1:
                libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /usr/lib/x86_64-linux-gnu/libcuda.so.1:
                libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
                librt.so.1 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/librt.so.1
                libm.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libm.so.6
                libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /usr/lib/x86_64-linux-gnu/libnvcuvid.so.1:
                libm.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libm.so.6
                libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libm.so.6:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
        /usr/lib/x86_64-linux-gnu/libnvidia-fatbinaryloader.so.390.25:
                libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
                libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6

The only available cuvid in my system is:

/usr/lib/x86_64-linux-gnu/libnvcuvid.so.1
/usr/lib/x86_64-linux-gnu/libnvcuvid.so.390.25
/usr/lib/x86_64-linux-gnu/libnvcuvid.so

So I think this is not the issue.

A less plausible explanation is just some installation or setup problem with your cuvid setup. To test this, I would download the NVIDIA Video SDK and compile + run the samples, particularly the "decodeGL" one. If those fail then that rules out NVPipe.

NVIDIA Video SDK samples run properly, I don't have any crashes at all, even decoding 4K videos. So I think my Video SDK installation is OK.

Looking more closely at the backtrace, there's a couple things that are of interest. One is that your nvp_cuvid_decode stack has a lot of variables (widthUser etc.) that seem to be uninitialized (this is likely a debuginfo problem / red herring). The other is that you appear to be using OpenGL. There may be issues mixing/associating OGL and CUDA devices. It would be informative if you could reproduce this without OpenGL in the mix, i.e. with just a buffer you've created yourself.

I have just tried the suggested approach. Same segfault in the same place. BT:

Thread 1 "zero-latency-cl" received signal SIGSEGV, Segmentation fault.
0x00007ffff7bc9362 in initialize_parser (nvp=0x5555557dafc0) at .../NvPipe/decode.c:275
275         if(cuvidCreateVideoParser(&nvp->parser, &prs) != CUDA_SUCCESS) {
(gdb) bt full
#0  0x00007ffff7bc9362 in initialize_parser (nvp=0x5555557dafc0) at .../NvPipe/decode.c:275
        prs = {CodecType = cudaVideoCodec_H264, ulMaxNumDecodeSurfaces = 2, ulClockRate = 0, ulErrorThreshold = 100, ulMaxDisplayDelay = 0, uReserved1 = {0, 0, 0, 0, 0},
          pUserData = 0x5555557dafc0, pfnSequenceCallback = 0x7ffff7bc8fdb <dec_sequence>, pfnDecodePicture = 0x7ffff7bc91bc <dec_ode>,
          pfnDisplayPicture = 0x7ffff7bc9269 <dec_display>, pvReserved2 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, pExtVideoInfo = 0x0}
        __FUNCTION__ = "initialize_parser"
#1  0x00007ffff7bc9884 in nvp_cuvid_decode (cdc=0x5555557dafc0, ibuf=0x7fffe5216010, ibuf_sz=483, obuf=0x7fffe4a2c010, width=1920, height=1080, format=NVPIPE_RGBA)
    at ..../NvPipe/decode.c:391
        perr = 32767
        __FUNCTION__ = "nvp_cuvid_decode"
        nvp = 0x5555557dafc0
        __PRETTY_FUNCTION__ = "nvp_cuvid_decode"
        components = 4
        widthUser = 4160715496
        heightUser = 32767
        widthDevice = 10
        heightDevice = 0
        pkt = {flags = 8294416, payload_size = 140737333929039, payload = 0x3 <error: Cannot access memory at address 0x3>, timestamp = 140737488345061}
        parse = 4143938304
        map = {progressive_frame = 3, second_field = 0, top_field_first = 1, unpaired_field = 0, reserved_flags = 4143924224, reserved_zero = 32767, raw_input_dptr = 140737333844539,
          raw_input_pitch = 4294957488, raw_input_format = 32767, raw_output_dptr = 0, raw_output_pitch = 4294957168, Reserved1 = 32767, output_stream = 0x3, Reserved = {4149839584,
            32767, 0, 0, 4149843872, 32767, 1439226208, 21845, 4143938304, 32767, 8294416, 0, 4294957712, 32767, 10000, 0, 8294416, 0, 4140543442, 32767, 126, 32767, 8294400, 0,
            4294957168, 32767, 4294957167, 32767, 4143921344, 32767, 4140508210, 32767, 4098, 21845, 10129, 4294934528, 129600, 0, 518401, 129648, 16200, 0, 2025, 0, 16291, 2135},
          Reserved2 = {0xfd, 0x1f}}
        pitch = 32767
        data = 140737488345744
        mrs = 32767
        evt = 8294416
        evwait = cudaSuccess
        orgerr = 8298496
        maperr = CUDA_SUCCESS
#2  0x00007ffff7bcd4ae in nvpipe_decode (codec=0x5555557dafc0, ibuf=0x7fffe5216010, ibuf_sz=483, obuf=0x7fffe4a2c010, width=1920, height=1080, format=NVPIPE_RGBA)
    at ..../NvPipe/api.c:104
        __PRETTY_FUNCTION__ = "nvpipe_decode"
        dec = 0x5555557dafc0
#3  0x000055555555a875 in main (argc=1, argv=0x7fffffffda98) at .../zero-latency/src/client.cpp:227
        decoder = 0x5555557dafc0
        clientDeviceBufferSize = 8294400
        clientDeviceBuffer = 0x7fffe5a00000
        clientReceiveBufferSize = 8294400
        clientReceiveBuffer = 0x7fffe5216010 ""
        address = {sin_family = 17736, sin_port = 21884, sin_addr = {s_addr = 0}, sin_zero = "\215\022[UUU\000"}
        sock = 23
        serv_addr = {sin_family = 2, sin_port = 30755, sin_addr = {s_addr = 16777343}, sin_zero = "00000000"}
        size = 483
        len = 483
        nbuffer = 483
        imgsz = 8294400
        rgb = 0x7fffe4a2c010 ""
        numBytes = 8294400
        decodeStatus = 32767

@tfogal
Copy link
Contributor

tfogal commented Mar 7, 2018

Hrm, I am perplexed, then.
Is it possible that you could post your simplified source as e.g. a github gist or similar? something I could compile+run here.

@omaralvarez
Copy link
Contributor Author

omaralvarez commented Mar 7, 2018

Yes, of course. I have created a repo:

https://github.com/omaralvarez/zero-latency

It is compiled using cmake. Should be straight forward doing an out of source build. Sorry for the ugly code, coded the sample in a rush. If it works I can spruce it up so it can serve as a starting point for other projects.

@tfogal
Copy link
Contributor

tfogal commented Mar 9, 2018

Thanks. It appears this repo still has OpenGL and sockets and the like. Is the simplified version perhaps in a branch/tag that you've not yet pushed?

@omaralvarez
Copy link
Contributor Author

omaralvarez commented Mar 12, 2018

Done. OpenGL was just in the CMakeLists, I have now removed everything and also added a standalone example without OpenGL or sockets. Now it creates 3 executables, client, server and standalone.

@omaralvarez
Copy link
Contributor Author

I think I have some new clues. CUDA 9.1 has no nvcuvid.h, so I think nvcuvid is no longer included in CUDA. I'm guessing that one has to include dynlink_nvcuvid.h and compile the corresponding .cpp in order for this to work. So I think this is a compilation problem with new versions of CUDA/Video SDK.

I may be able to help with this, if someone can confirm that my suspicions are correct.

@tfogal
Copy link
Contributor

tfogal commented Mar 16, 2018

Someone else mentioned issues with the CUDA 9 series, so you're likely on to something. I haven't yet had time to investigate, unfortunately.

Note that NVPipe's CMake has a variable for specifying an external video sdk "install". You'll want to specify that when trying with a new SDK.

@omaralvarez
Copy link
Contributor Author

Got it, I will keep on trying to find out the root cause of the problem and report back if I do.

@tbiedert
Copy link
Contributor

I've just pushed a redesigned NvPipe which works with CUDA 9.
Please refer to the README for its features and usage.

@omaralvarez
Copy link
Contributor Author

I will test it out and let you know if everything went ok. Thanks!

@omaralvarez
Copy link
Contributor Author

Everything is working now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants