After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791724 - nvdec: update for CUDA 9
nvdec: update for CUDA 9
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-18 10:12 UTC by Tim-Philipp Müller
Modified: 2018-04-17 13:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (14.51 KB, patch)
2018-03-04 13:34 UTC, Snir
none Details | Review
proposed patch v2 (14.86 KB, patch)
2018-03-22 09:20 UTC, Snir
none Details | Review
proposed patch v2 (14.87 KB, patch)
2018-04-10 14:17 UTC, Snir
none Details | Review

Description Tim-Philipp Müller 2017-12-18 10:12:21 UTC
nvcuvid.h appears to be gone, see bug #781537 comment 51.
Comment 1 Snir 2018-03-04 13:34:29 UTC
Created attachment 369266 [details] [review]
proposed patch
Comment 2 Sebastian Dröge (slomo) 2018-03-05 08:13:49 UTC
Review of attachment 369266 [details] [review]:

Thanks for the patch! Does the same also apply to nvenc?

::: sys/nvdec/dynlink_cuda.c
@@ +28,3 @@
+#include <stdio.h>
+#include <dynlink_cuda.h>
+#include <GL/freeglut.h>

Why glut?

@@ +51,3 @@
+tcuGraphicsGLRegisterImage *cuGraphicsGLRegisterImage;
+
+static char CudaLibName[] = "libcuda.so";

Previously the plugin also worked at least on Windows

@@ +81,3 @@
+  }
+  //Init
+  _cuInit = (tcuInit *) dlsym (lib, "cuInit");

Would be better to use gmodule for these
Comment 3 Snir 2018-03-05 09:16:12 UTC
(In reply to Sebastian Dröge (slomo) from comment #2)
> Review of attachment 369266 [details] [review] [review]:
> 
> Thanks for the patch! Does the same also apply to nvenc?
> 

Probably not, It uses only symbols needed by nvdec, could be expanded for nvenc 
 
> ::: sys/nvdec/dynlink_cuda.c
> @@ +28,3 @@
> +#include <stdio.h>
> +#include <dynlink_cuda.h>
> +#include <GL/freeglut.h>
> 
> Why glut?
> 

It was just for the GLenum GLuint but probably can just typedef these instead

> @@ +51,3 @@
> +tcuGraphicsGLRegisterImage *cuGraphicsGLRegisterImage;
> +
> +static char CudaLibName[] = "libcuda.so";
> 
> Previously the plugin also worked at least on Windows
> 

Missed that..

> @@ +81,3 @@
> +  }
> +  //Init
> +  _cuInit = (tcuInit *) dlsym (lib, "cuInit");
> 
> Would be better to use gmodule for these

True.

Thanks! I hope to have some time to fix these issues soon.

Snir.
Comment 4 Sebastian Dröge (slomo) 2018-03-05 10:11:34 UTC
(In reply to Snir from comment #3)

> > ::: sys/nvdec/dynlink_cuda.c
> > @@ +28,3 @@
> > +#include <stdio.h>
> > +#include <dynlink_cuda.h>
> > +#include <GL/freeglut.h>
> > 
> > Why glut?
> > 
> 
> It was just for the GLenum GLuint but probably can just typedef these instead

You could include the GStreamer GL headers probably, or indeed just typedef or use a different type (unsigned int?) directly :)
Comment 5 Snir 2018-03-22 09:20:51 UTC
Created attachment 369995 [details] [review]
proposed patch v2
Comment 6 Snir 2018-04-10 14:17:19 UTC
Created attachment 370733 [details] [review]
proposed patch v2

Just added a missing space ;)
Comment 7 Jan Schmidt 2018-04-17 13:34:25 UTC
Thanks, pushed:

commit 73cd1aa9dc1d9c56caaa8bf60198afdd26a58f06
Author: Snir Sheriber <ssheribe@redhat.com>
Date:   Thu Mar 22 10:18:57 2018 +0200

    nvdec/nvenc: Support CUDA Toolkit 9
    
    Since cuda-tools 9.0, nvcuvid.h is replaced by dynlink_nvcuvid.h.
    This patch changes nvdec to use run-time dynamic linking if
    cuda-tools version >= 9.
    nvenc does not require any change since its necessary headers are
    still available.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791724