jcuda / jcuda-main

Summarizes the main JCuda libraries
MIT License
98 stars 20 forks source link

mvn clean install fails at jcuda step #57

Closed bfatehi closed 1 year ago

bfatehi commented 1 year ago

I was following the build guide and reached the step where we use mvn clean install. The Jcuda-parent install worked as expected but the Jcuda-main directory failed. It reached the step where it was attempting to install the Jcuda package. I reran with the -e flag to gain insight from errors but am unsure what the error is attempting to inform me of. Here is the git bash session:

$ mvn clean install -e [INFO] Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] JCuda [pom] [INFO] jcuda-common [jar] [INFO] jcuda-natives [jar] [INFO] jcuda [jar] [INFO] jcublas-natives [jar] [INFO] jcublas [jar] [INFO] jcufft-natives [jar] [INFO] jcufft [jar] [INFO] jcurand-natives [jar] [INFO] jcurand [jar] [INFO] jcusparse-natives [jar] [INFO] jcusparse [jar] [INFO] jcusolver-natives [jar] [INFO] jcusolver [jar] [INFO] jcudnn-natives [jar] [INFO] jcudnn [jar] [INFO] jcuda-main [pom] [INFO] [INFO] -----------------------< org.jcuda:jcuda-parent >----------------------- [INFO] Building JCuda 11.8.0 [1/17] [INFO] from ..\jcuda-parent\pom.xml [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] --- clean:3.2.0:clean (default-clean) @ jcuda-parent --- [INFO] [INFO] >>> source:2.1.2:jar (attach-sources) > generate-sources @ jcuda-parent >>> [INFO] [INFO] <<< source:2.1.2:jar (attach-sources) < generate-sources @ jcuda-parent <<< [INFO] [INFO] [INFO] --- source:2.1.2:jar (attach-sources) @ jcuda-parent --- [INFO] [INFO] --- javadoc:2.10.1:jar (attach-javadocs) @ jcuda-parent --- [INFO] Not executing Javadoc as the project is not a Java classpath-capable package [INFO] [INFO] --- install:3.1.0:install (default-install) @ jcuda-parent --- [INFO] Installing C:\JCuda\jcuda-parent\pom.xml to C:\Users\bfate.m2\repository\org\jcuda\jcuda-parent\11.8.0\jcuda-parent-11.8.0.pom [INFO] [INFO] -----------------------< org.jcuda:jcuda-common >----------------------- [INFO] Building jcuda-common 11.8.0 [2/17] [INFO] from ..\jcuda-common\pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- clean:3.2.0:clean (default-clean) @ jcuda-common --- [INFO] Deleting C:\JCuda\jcuda-common\target [INFO] [INFO] --- resources:3.3.0:resources (default-resources) @ jcuda-common --- [INFO] skip non existing resourceDirectory C:\JCuda\jcuda-common\src\main\resources [INFO] [INFO] --- compiler:2.3.2:compile (default-compile) @ jcuda-common --- [INFO] No sources to compile [INFO] [INFO] --- resources:3.3.0:testResources (default-testResources) @ jcuda-common --- [INFO] skip non existing resourceDirectory C:\JCuda\jcuda-common\src\test\resources [INFO] [INFO] --- compiler:2.3.2:testCompile (default-testCompile) @ jcuda-common --- [INFO] No sources to compile [INFO] [INFO] --- surefire:3.0.0:test (default-test) @ jcuda-common --- [INFO] No tests to run. [INFO] [INFO] --- jar:3.0.2:jar (default-jar) @ jcuda-common --- [INFO] Building jar: C:\JCuda\jcuda-common\target\jcuda-common-11.8.0.jar [INFO] [INFO] --- jar:3.0.2:jar (create-native-sources-jar) @ jcuda-common --- [INFO] Building jar: C:\JCuda\jcuda-common\target\jcuda-common-11.8.0-sources.jar [INFO] [INFO] --- jar:3.0.2:jar (create-native-javadoc-jar) @ jcuda-common --- [INFO] Building jar: C:\JCuda\jcuda-common\target\jcuda-common-11.8.0-javadoc.jar [INFO] [INFO] >>> source:2.1.2:jar (attach-sources) > generate-sources @ jcuda-common >>> [INFO] [INFO] <<< source:2.1.2:jar (attach-sources) < generate-sources @ jcuda-common <<< [INFO] [INFO] [INFO] --- source:2.1.2:jar (attach-sources) @ jcuda-common --- [INFO] No sources in project. Archive not created. [INFO] [INFO] --- javadoc:2.10.1:jar (attach-javadocs) @ jcuda-common --- [INFO] [INFO] --- install:3.1.0:install (default-install) @ jcuda-common --- [INFO] Installing C:\JCuda\jcuda-common\pom.xml to C:\Users\bfate.m2\repository\org\jcuda\jcuda-common\11.8.0\jcuda-common-11.8.0.pom [INFO] Installing C:\JCuda\jcuda-common\target\jcuda-common-11.8.0.jar to C:\Users\bfate.m2\repository\org\jcuda\jcuda-common\11.8.0\jcuda-common-11.8.0.jar [INFO] Installing C:\JCuda\jcuda-common\target\jcuda-common-11.8.0-sources.jar to C:\Users\bfate.m2\repository\org\jcuda\jcuda-common\11.8.0\jcuda-common-11.8.0-sources.jar [INFO] Installing C:\JCuda\jcuda-common\target\jcuda-common-11.8.0-javadoc.jar to C:\Users\bfate.m2\repository\org\jcuda\jcuda-common\11.8.0\jcuda-common-11.8.0-javadoc.jar [INFO] [INFO] ----------------------< org.jcuda:jcuda-natives >----------------------- [INFO] Building jcuda-natives 11.8.0 [3/17] [INFO] from ..\jcuda\pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- clean:3.2.0:clean (default-clean) @ jcuda-natives --- [INFO] Deleting C:\JCuda\jcuda\target [INFO] [INFO] --- resources:3.3.0:resources (default-resources) @ jcuda-natives --- [INFO] skip non existing resourceDirectory C:\JCuda\jcuda\src\main\resources [INFO] [INFO] --- compiler:2.3.2:compile (default-compile) @ jcuda-natives --- [INFO] No sources to compile [INFO] [INFO] --- resources:3.3.0:testResources (default-testResources) @ jcuda-natives --- [INFO] skip non existing resourceDirectory C:\JCuda\jcuda\src\test\resources [INFO] [INFO] --- compiler:2.3.2:testCompile (default-testCompile) @ jcuda-natives --- [INFO] No sources to compile [INFO] [INFO] --- surefire:3.0.0:test (default-test) @ jcuda-natives --- [INFO] No tests to run. [INFO] [INFO] --- jar:3.0.2:jar (default-jar) @ jcuda-natives --- [INFO] Building jar: C:\JCuda\jcuda\target\jcuda-natives-11.8.0.jar [INFO] [INFO] --- jar:3.0.2:jar (create-native-jar) @ jcuda-natives --- [INFO] Building jar: C:\JCuda\jcuda\target\jcuda-natives-11.8.0-windows-x86_64.jar [INFO] [INFO] --- jar:3.0.2:jar (create-native-sources-jar) @ jcuda-natives --- [INFO] Building jar: C:\JCuda\jcuda\target\jcuda-natives-11.8.0-sources.jar [INFO] [INFO] --- jar:3.0.2:jar (create-native-javadoc-jar) @ jcuda-natives --- [INFO] Building jar: C:\JCuda\jcuda\target\jcuda-natives-11.8.0-javadoc.jar [INFO] [INFO] >>> source:2.1.2:jar (attach-sources) > generate-sources @ jcuda-natives >>> [INFO] [INFO] <<< source:2.1.2:jar (attach-sources) < generate-sources @ jcuda-natives <<< [INFO] [INFO] [INFO] --- source:2.1.2:jar (attach-sources) @ jcuda-natives --- [INFO] No sources in project. Archive not created. [INFO] [INFO] --- javadoc:2.10.1:jar (attach-javadocs) @ jcuda-natives --- [INFO] [INFO] --- install:3.1.0:install (default-install) @ jcuda-natives --- [INFO] Installing C:\JCuda\jcuda\pom.xml to C:\Users\bfate.m2\repository\org\jcuda\jcuda-natives\11.8.0\jcuda-natives-11.8.0.pom [INFO] Installing C:\JCuda\jcuda\target\jcuda-natives-11.8.0.jar to C:\Users\bfate.m2\repository\org\jcuda\jcuda-natives\11.8.0\jcuda-natives-11.8.0.jar [INFO] Installing C:\JCuda\jcuda\target\jcuda-natives-11.8.0-windows-x86_64.jar to C:\Users\bfate.m2\repository\org\jcuda\jcuda-natives\11.8.0\jcuda-natives-11.8.0-windows-x86_64.jar [INFO] Installing C:\JCuda\jcuda\target\jcuda-natives-11.8.0-sources.jar to C:\Users\bfate.m2\repository\org\jcuda\jcuda-natives\11.8.0\jcuda-natives-11.8.0-sources.jar [INFO] Installing C:\JCuda\jcuda\target\jcuda-natives-11.8.0-javadoc.jar to C:\Users\bfate.m2\repository\org\jcuda\jcuda-natives\11.8.0\jcuda-natives-11.8.0-javadoc.jar [INFO] [INFO] --------------------------< org.jcuda:jcuda >--------------------------- [INFO] Building jcuda 11.8.0 [4/17] [INFO] from ..\jcuda\JCudaJava\pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- clean:3.2.0:clean (default-clean) @ jcuda --- [INFO] Deleting C:\JCuda\jcuda\JCudaJava\target [INFO] [INFO] --- resources:3.3.0:resources (default-resources) @ jcuda --- [INFO] skip non existing resourceDirectory C:\JCuda\jcuda\JCudaJava\src\main\resources [INFO] [INFO] --- compiler:2.3.2:compile (default-compile) @ jcuda --- [INFO] Compiling 218 source files to C:\JCuda\jcuda\JCudaJava\target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] error: Source option 7 is no longer supported. Use 8 or later. [ERROR] error: Target option 7 is no longer supported. Use 8 or later. [INFO] 2 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for jcuda-main 11.8.0: [INFO] [INFO] JCuda .............................................. SUCCESS [ 0.693 s] [INFO] jcuda-common ....................................... SUCCESS [ 0.454 s] [INFO] jcuda-natives ...................................... SUCCESS [ 0.263 s] [INFO] jcuda .............................................. FAILURE [ 0.072 s] [INFO] jcublas-natives .................................... SKIPPED [INFO] jcublas ............................................ SKIPPED [INFO] jcufft-natives ..................................... SKIPPED [INFO] jcufft ............................................. SKIPPED [INFO] jcurand-natives .................................... SKIPPED [INFO] jcurand ............................................ SKIPPED [INFO] jcusparse-natives .................................. SKIPPED [INFO] jcusparse .......................................... SKIPPED [INFO] jcusolver-natives .................................. SKIPPED [INFO] jcusolver .......................................... SKIPPED [INFO] jcudnn-natives ..................................... SKIPPED [INFO] jcudnn ............................................. SKIPPED [INFO] jcuda-main ......................................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.575 s [INFO] Finished at: 2023-04-26T16:16:57-04:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project jcuda: Compilation failure: Compilation failure: [ERROR] error: Source option 7 is no longer supported. Use 8 or later. [ERROR] error: Target option 7 is no longer supported. Use 8 or later. [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project jcuda: Compilation failure at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:347) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:827) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:272) at org.apache.maven.cli.MavenCli.main (MavenCli.java:195) at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104) at java.lang.reflect.Method.invoke (Method.java:578) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure at org.apache.maven.plugin.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:656) at org.apache.maven.plugin.CompilerMojo.execute (CompilerMojo.java:128) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:827) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:272) at org.apache.maven.cli.MavenCli.main (MavenCli.java:195) at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104) at java.lang.reflect.Method.invoke (Method.java:578) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :jcuda

Unless I am missing something, the error appears to say "Source option 7 is no longer supported. Use 8 or later." What is source option 7 or 8? Any insight will be greatly appreciated, I'm attempting to use your Jcuda library to help a genomics lab using HiCCUPS.

bfatehi commented 1 year ago

I attempted to rebuild Jcuda from scratch:

This is how my cmake cache looks:

image image image image

I noticed that there was an error when using visual studio to build the project after completing cmake:

image image image

Unsure whether the issue I experienced before and this one are directly related or not. I read another post where someone had an error during mvn clean install but they were on linux so their path solution didn't directly help me unfortunately.

I'll keep messing with it but any insight would be appreciated.

bfatehi commented 1 year ago

I changed the visual studio build configuration to release instead of debug and everything completed without error though I am unsure whether this is a valid solution to the VS problem. The mvn clean install problem has persisted, however, with the same error "error: Source option 7 is no longer supported. Use 8 or later."

bfatehi commented 1 year ago

The build appears to have succeeded after changing the maven-compiler in pom to 1.8 from 1.7:

`

maven-compiler-plugin
            <version>2.3.2</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

`

Now, however, when I run HiCCUPS, It seems that java and jcuda are not properly linked:

Exception in thread "pool-2-thread-14" java.lang.UnsatisfiedLinkError: Error while loading native library "JCudaRuntime-0.8.0-windows-x86_64" Operating system name: Windows 11 Architecture : amd64 Architecture bit size: 64 ---(start of nested stack traces)--- Stack trace from the attempt to load the library as a file: java.lang.UnsatisfiedLinkError: no JCudaRuntime-0.8.0-windows-x86_64 in java.library.path: C:\Program Files\Java\jdk-20\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Users\bfate\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\bfate\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\libnvvp;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\IncrediBuild;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64;C:\Program Files\CMake\bin;C:\Program Files\ZLib\zlib123dllx64\dll_x64;C:\Program Files\NVIDIA Corporation\Nsight Compute 2022.3.0;C:\Program Files\NVIDIA\CUDNN\Cuda11.8\bin;C:\Program Files\apache-maven-3.9.1-bin\apache-maven-3.9.1\bin;C:\Program Files\Java\jdk-20\bin;C:\Users\bfate\AppData\Local\Microsoft\WindowsApps;C:\Users\bfate.dotnet\tools;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl;. at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2444) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:880) at java.base/java.lang.System.loadLibrary(System.java:2051) at jcuda.LibUtils.loadLibrary(LibUtils.java:143) at jcuda.runtime.JCuda.initialize(JCuda.java:406) at jcuda.runtime.JCuda.(JCuda.java:390) at jcuda.driver.JCudaDriver.(JCudaDriver.java:277) at jcuda.utils.KernelLauncher.initialize(KernelLauncher.java:603) at jcuda.utils.KernelLauncher.(KernelLauncher.java:586) at jcuda.utils.KernelLauncher.create(KernelLauncher.java:393) at jcuda.utils.KernelLauncher.create(KernelLauncher.java:321) at jcuda.utils.KernelLauncher.compile(KernelLauncher.java:270) at juicebox.tools.utils.juicer.hiccups.GPUController.(GPUController.java:72) at juicebox.tools.clt.juicer.HiCCUPS.buildGPUController(HiCCUPS.java:559) at juicebox.tools.clt.juicer.HiCCUPS.runCoreCodeForHiCCUPS(HiCCUPS.java:486) at juicebox.tools.clt.juicer.HiCCUPS.access$200(HiCCUPS.java:158) at juicebox.tools.clt.juicer.HiCCUPS$1.run(HiCCUPS.java:415) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1623) Stack trace from the attempt to load the library as a resource: java.io.IOException: No resource found with name '/lib/JCudaRuntime-0.8.0-windows-x86_64.dll' at jcuda.LibUtils.writeResourceToFile(LibUtils.java:323) at jcuda.LibUtils.loadLibraryResource(LibUtils.java:255) at jcuda.LibUtils.loadLibrary(LibUtils.java:158) at jcuda.runtime.JCuda.initialize(JCuda.java:406) at jcuda.runtime.JCuda.(JCuda.java:390) at jcuda.driver.JCudaDriver.(JCudaDriver.java:277) at jcuda.utils.KernelLauncher.initialize(KernelLauncher.java:603) at jcuda.utils.KernelLauncher.(KernelLauncher.java:586) at jcuda.utils.KernelLauncher.create(KernelLauncher.java:393) at jcuda.utils.KernelLauncher.create(KernelLauncher.java:321) at jcuda.utils.KernelLauncher.compile(KernelLauncher.java:270) at juicebox.tools.utils.juicer.hiccups.GPUController.(GPUController.java:72) at juicebox.tools.clt.juicer.HiCCUPS.buildGPUController(HiCCUPS.java:559) at juicebox.tools.clt.juicer.HiCCUPS.runCoreCodeForHiCCUPS(HiCCUPS.java:486) at juicebox.tools.clt.juicer.HiCCUPS.access$200(HiCCUPS.java:158) at juicebox.tools.clt.juicer.HiCCUPS$1.run(HiCCUPS.java:415) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1623) ---(end of nested stack traces)---

It might be that I now need to add the jcuda native libraries to the Java library path.

Any insight would be greatly appreciated.

bfatehi commented 1 year ago

I have now attempted a number of processes.

1)I have added the location of the .dll files for jcuda into they system environment PATH 2)I added the .dll files directly into the directory that I am attempting to run my program from 3)I attempted to add files into the java lib directory directly.

Nothing has changed, I still get the same error.

I realize now that I forgot to mention that I am on Cuda 11.8, your most recent Jcuda release and Cudnn 11.

jcuda commented 1 year ago

That's a lot of information and text...


Regarding the first build error:

As you already figured out, the message

error: Source option 7 is no longer supported. Use 8 or later.

is almost certanily caused by the target version for the Java code in the jcuda-parent POM at https://github.com/jcuda/jcuda-parent/blob/ead8b3f8be6cccd0caac8b94c5ae0507d2bd4f86/pom.xml#L145 . You're probably using a more recent Java version, something like ... you know, larger than 8. I'm already feeling like a 👴 for still using Java 8 locally. It might well be that 1.7 is no longer supported as a target, and I think that it's reasonable to update the POM to target 8/1.8.


Regarding the other build error:

The message

Mismatch detected for _ITERATOR_DEBUG_LEVEL

indicates that you tried to mix "Debug" and "Release" builds. I think that it should be possible to create a "Debug" build as well (and have to check whether this is possible or why it may not be possible). But the solution is indeed what you did then:

I changed the visual studio build configuration to release instead of debug and everything completed without error though I am unsure whether this is a valid solution to the VS problem.

Setting the build to "Release" is the right thing to do here.


The last message...

java.lang.UnsatisfiedLinkError: Error while loading native library "JCudaRuntime-0.8.0-windows-x86_64"

This looks like you have been using the JAR files for version 0.8.0 (maybe as downloaded from the website?!) and mixing them with the DLL files for another version. Note that the JAR files are always trying to load a DLL with a specific version

(The current pointer would be https://github.com/jcuda/jcuda/blob/a8663fc9287ad1506aedc865e7195ef2b832dc85/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L454 - that changed slightly since version 0.8.0, but the concept is still the same).

So when you use the JAR files that have been generated with the latest mvn build and the DLLs that have been craeted with the latest VisualStudio build, things should work.

....or....

Just declare JCuda as a Maven dependency for your project....

bfatehi commented 1 year ago

Thank you for your reply and apologies for the wall of text! I'm trying to keep it as well documented as I can so I can point towards this on the juicer forum so that others might be able to troubleshoot their way through this if they find themselves in a similar situation.

Regarding unsatisfied link error: Just to clarify, are you saying that the Jcuda version I downloaded is incorrect or the one that the project I'm attempting to use is calling for the incorrect version? I followed the build guide in jcuda-main which states to pull the files into a jcuda folder using the git commands, use cmake on them into a jcuda.build folder, and use Visual Studio to complete the build. Then I installed the jcuda/jcuda-parent and jcuda/jcuda-main directory using mvn clean install. I then attempted to add the "C:\JCuda\jcuda\nativeLibraries\windows\x86_64\lib" and the "C:\JCuda\jcuda-main\output" into the System Environment Path so that there should be access to the dll and jar files.

I believe the Juicer project (https://github.com/aidenlab/juicer) might use an older version of Jcuda according to their documentation but they state that any version should work as long as it corresponds to the user's cuda version. I am also unfamiliar with how to mavenize a project and was attempting to read through maven's documentation but was getting a bit lost. I created a pom.xml and put the dependencies and ran "mvn clean package" but was getting errors. The project is not my own, it is a program designed to help in genomic lab analysis however the tool I am attempting to use was originally designed for use with cuda 7.5 and my gpu only has compatibility up to cuda 8.9 according to nvidia documentation. This is where the project mentions gpu use:

image

If I can get it to work on my gpu it will be significantly faster than using it on my cpu and would help immensely.

I believe what you are describing is that the project I'm attempting to use is attempting to call the incorrect Jcuda version since this one should be 11.8.0 and the error mentions 0.8.0. I will run with the assumption and try to adjust the call for now.

bfatehi commented 1 year ago

I got it working...I had to recompile their jar file using the updated version in their build.xml file. It now points to jcuda 11.8 rather than 0.8.0.

Thanks for keeping this project up to date by the way. I would not have been able to use my gpu on this project otherwise. Your work is greatly appreciated. The process that this program uses moves significantly slower when using a cpu.

jcuda commented 1 year ago

I might be lacking some context, and may have to look up what the project that you linked to is actually doing with JCuda. In the README, they are saying

... but you will need to download the respective native libraries from JCuda.

with the direct link to the "Downloads" page. But the "Downloads" are no longer updated: The usual way to integrate JCuda is to declare it as a Maven dependency. (Maybe I should emphasize that even more on the "Downloads" page, or even open an issue in the "juicer" repo...?)

From what you said, it sounds like they may already have added JCuda as a Maven dependency somewhere, but with version number 0.8.0 (the first version that was put into Maven Central). I also saw some "Juicer toosl jar" downlads there that all mentioned "(CUDA 8.0)", so maybe they essentially did their implementation for CUDA 8.0, and don't need any newer version...

(An aside: Usually, the JCuda version has to match the CUDA version on the client. So when someone has installted CUDA 16.1, then he'll also need JCuda 16.1.0. From what I've heard, it often also "just works" when the CUDA version is newer than the JCuda version, but it's hard to guarantee that)

Thanks for keeping this project up to date by the way

It's a bit slow. https://github.com/jcuda/jcuda-main/issues/56 has been open for quite a while now, and they already published 12.1 now...

bfatehi commented 1 year ago

Yea so I believe that the readme is a bit out of date. There is a portion in the readme that gives access to a jar file that is maintained in another one of their repos called juicebox. The link takes you to a juicer_tools2.x release list of jar files. These jar files are compiled with jcuda 0.8.0 for use with the corresponding cuda library which (based on their documentation) I believe might be 7.0 or 7.5 (but didn't look too far into it because I can't run cuda versions that are that old). They do provide you with the source code in that juicebox repo which I had to adjust a bit for my own purposes.

Their project is based around apache ant compilation. I had to adjust the project.properties file towards my jdk path, the project main build.xml towards jcuda 11.8 instead of 0.8 for the windows versions, changed the jcuda build.xml in their project to point towards the 11.8 build as well. Then I had to move their older jcuda windows jars into an archive folder and place the new ones I compiled and installed using your build guide. I specifically mention for the windows versions because they have 2 linux builds x86_64 and ppc and a mac build included in the jar which would not affect my particular use case. I

If you want to take a look at the project, the repos are here: https://github.com/aidenlab/juicer and here: https://github.com/aidenlab/Juicebox

I will probably open up and issue and link this issue so people might have an easier time in the future or more concisely document my experience to act as a guide of sorts. I'm not too familiar with maven to be honest, this project is the first time I have come across it. I'm unsure how to convert a project into a mavenized project if it doesn't start as one or if there is an easy conversion from ant to maven (since they are both apache products).

Regarding the progress of issue 56, take your time, the most recent nvidia gpu releases still work with cuda 11 and cudnn still allows the cuda 11 version to be downloaded. Your work on the 11 version was very helpful to me and is greatly appreciated.

jcuda commented 1 year ago

... maven to be honest, this project is the first time I have come across it.

Maven is pretty much "the" standard nowadays. From the user perspective, it's astonishingly convenient: Just add that <dependency> and you're good.

If... iff... everybody down the chain did things right: When you want to create a Maven project, things can become tricky. Particularly when

  1. the project is not freshly set up, and uses some old/custom build infrastructure or dependency management
  2. the project involves native libraries...

The second one applies to JCuda, and it was quite a pain in the back (and required a few iterations) to come to the current state.

The first one is what you referred to:

I'm unsure how to convert a project into a mavenized project

I think that in Eclipse, it's as easy as right-clicking the project and saying "Convert to Maven". Otherwise, the transition may either be easy or a bit tricky, depending on "how much Ant-specific infrastructure" was built into the project...

bfatehi commented 1 year ago

Yea, it seems super convenient, perhaps I will recommend to add maven support or attempt to do so myself and propose the change for ease of use on future users.