GNOME Bugzilla – Bug 791724
nvdec: update for CUDA 9
Last modified: 2018-04-17 13:34:25 UTC
nvcuvid.h appears to be gone, see bug #781537 comment 51.
Created attachment 369266 [details] [review] proposed patch
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
(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.
(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 :)
Created attachment 369995 [details] [review] proposed patch v2
Created attachment 370733 [details] [review] proposed patch v2 Just added a missing space ;)
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