jcuda-main icon indicating copy to clipboard operation
jcuda-main copied to clipboard

Problem With Duplicated Classes

Open AvalonXD opened this issue 2 years ago • 6 comments

Duplicate class jcuda.BufferUtils found in modules jetified-jcuda-10.1.0 (jcuda-10.1.0.jar) and jetified-jcuda-10.1.0 (org.jcuda:jcuda:10.1.0)
Duplicate class jcuda.CudaException found in modules jetified-jcuda-10.1.0 (jcuda-10.1.0.jar) and jetified-jcuda-10.1.0 (org.jcuda:jcuda:10.1.0)
Duplicate class jcuda.LibUtils found in modules jetified-jcuda-10.1.0 (jcuda-10.1.0.jar) and jetified-jcuda-10.1.0 (org.jcuda:jcuda:10.1.0)
Duplicate class jcuda.LibUtils$1 found in modules jetified-jcuda-10.1.0 (jcuda-10.1.0.jar) and jetified-jcuda-10.1.0 (org.jcuda:jcuda:10.1.0)
Duplicate class jcuda.LibUtils$ArchType found in modules jetified-jcuda-10.1.0 (jcuda-10.1.0.jar) and jetified-jcuda-10.1.0 (org.jcuda:jcuda:10.1.0)
Duplicate class jcuda.LibUtils$OSType found in modules jetified-jcuda-10.1.0 (jcuda-10.1.0.jar) and jetified-jcuda-10.1.0 (org.jcuda:jcuda:10.1.0)

And so on. Just a bunch of duplicated class issues I can't begin to pick apart. I've no real idea what's the issue here.

AvalonXD avatar Mar 24 '22 07:03 AvalonXD

I'm lacking some context here. Quickly searching for jetified indicates that this is related to Android...?

Trying to make sense of the error message:

... jetified-jcuda-10.1.0 (jcuda-10.1.0.jar) and jetified-jcuda-10.1.0 (org.jcuda:jcuda:10.1.0)
                           ^ no 'org'                                    ^ 'org' 

Could it be that the "module" (whatever that means in this context) is once called jcuda... and once called org.jcuda... and this is causing trouble, because some toolchain thinks that these are different modules, although they are the same one (accidentally "imported" with different names)?

jcuda avatar Mar 25 '22 15:03 jcuda

It seems so and I'm not sure how I'd fix that. If I delete all of JCuda from the project index the error doesn't show up so I can't begin to think it's an issue of the index install and then an install elsewhere.

AvalonXD avatar Apr 07 '22 13:04 AvalonXD

Again, I'm not familiar with "jetified", and may have to take a closer look at some technical details here (in order to provide more helpful answers, iff I can do this at all). But to get a first idea: How do you declare the JCuda dependency here in the first place? Is this some file like a Maven/Gradle POM where you list out the dependency using the Maven coordinates?

jcuda avatar Apr 08 '22 15:04 jcuda

I put "jcuda-10.1.0.jar" inside the libs folder of my app and then implement the usage.mg instructions in my build.gradle file for the app.

AvalonXD avatar Apr 09 '22 17:04 AvalonXD

Also actually can JCuda be used on android platforms besides? I'm getting a no matching ABIs and that's probably the problem thinking of it.

AvalonXD avatar Apr 11 '22 10:04 AvalonXD

Hm. I would have hesitated to update to the contents of the USAGE.md when it's not entirely clear whether this is actually working. Again, I'm not familar with Gradle, but could try to try it out at some point. But when you mentioned that you

put "jcuda-10.1.0.jar" inside the libs folder

then this sounds like it could be the reason for the problem. To my understanding, this should not be necessary.

(At least when using Maven, you don't manually copy JARs anywhere. The pom.xml declares the dependencies, and the JARs are downloaded internally and transparently)

What happens when you simply remove that JAR from the libs folder?


Also actually can JCuda be used on android platforms besides? I'm getting a no matching ABIs and that's probably the problem thinking of it.

That largely depends on the underlying architecture, but as far as I know, CUDA is not supported on Android (so JCuda won't work there either....)

jcuda avatar Apr 11 '22 12:04 jcuda