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

jniopencv_cudaobjdetect.dll: Can't find dependent libraries #592

Closed
jitterhorse opened this issue Jul 27, 2018 · 3 comments
Closed

jniopencv_cudaobjdetect.dll: Can't find dependent libraries #592

jitterhorse opened this issue Jul 27, 2018 · 3 comments
Labels

Comments

@jitterhorse
Copy link

jitterhorse commented Jul 27, 2018

Hi,
when i create:

CudaCascadeClassifier ccc;
String face_cascade_name = "haarcascade_frontalface_default.xml";
ccc = CudaCascadeClassifier.create(face_cascade_name);

i get

java.lang.UnsatisfiedLinkError: C:\Users\jitterhorse\workspace\LIBS\javacpp\opencv-3.4.2-1.4.2-windows-x86_64-gpu.jar\org\bytedeco\javacpp\windows-x86_64-gpu\jniopencv_cudaobjdetect.dll: Can't find dependent libraries
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1225)
	at org.bytedeco.javacpp.Loader.load(Loader.java:983)
	at org.bytedeco.javacpp.Loader.load(Loader.java:882)
	at org.bytedeco.javacpp.opencv_cudaobjdetect.<clinit>(opencv_cudaobjdetect.java:26)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.bytedeco.javacpp.Loader.load(Loader.java:941)
	at org.bytedeco.javacpp.Loader.load(Loader.java:882)
	at org.bytedeco.javacpp.opencv_cudaobjdetect$CudaCascadeClassifier.<clinit>(opencv_cudaobjdetect.java:306)
	at org.jitterhorse.mav.cppCV2.App.main(App.java:49)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\jitterhorse\.javacpp\cache\opencv-3.4.2-1.4.2-windows-x86_64-gpu.jar\org\bytedeco\javacpp\windows-x86_64-gpu\jniopencv_cudaobjdetect.dll: Can't find dependent libraries
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1205)

This is my POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.jitterhorse.mav</groupId>
  <artifactId>cppCV2</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>cppCV2</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
 
        <dependency>
        	<groupId>org.bytedeco.javacpp-presets</groupId>
        	<artifactId>opencv-platform</artifactId>
        	<version>3.4.2-1.4.2</version>
        </dependency>
         
        <dependency>
            <groupId>org.bytedeco.javacpp-presets</groupId>
            <artifactId>opencv</artifactId>
            <version>3.4.2-1.4.2</version>
            <classifier>windows-x86_64-gpu</classifier>
        </dependency>
 
        <dependency>
            <groupId>org.bytedeco.javacpp-presets</groupId>
            <artifactId>cuda</artifactId>
            <version>9.2-7.1-1.4.2</version>
            <classifier>windows-x86_64-redist</classifier>
        </dependency>

  </dependencies>
</project>

I'm on Windows 10 / 64 bit developing with Eclipse Oxygen and having Cuda 9.2 with cudnn 7.1 installed and registed in the system variables.

Do I need to install and build a OpenCV with CUDA myself?

I would be happy about any help!

Thanks in advance
jit

@saudet saudet added the bug label Jul 28, 2018
@saudet
Copy link
Member

saudet commented Jul 28, 2018

That's a bug in the presets. We need to load opencv_cudalegacy342.dll but it's missing from the preload list. For now, we can work around this easily by preloading some other module that also uses opencv_cudalegacy342.dll, for example opencv_stitching, like this:

Loader.load(org.bytedeco.javacpp.opencv_stitching.class);

Thanks for reporting!

@jitterhorse
Copy link
Author

Thank you very much! It's working now.
<3

saudet added a commit that referenced this issue Jul 28, 2018
@saudet
Copy link
Member

saudet commented Oct 16, 2018

Fix included in version 1.4.3! Thanks again for reporting.

@saudet saudet closed this as completed Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants