Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 21 06:04
    Musador13 starred Syncleus/aparapi-examples
  • Oct 25 19:27
    GZGavinZhao starred Syncleus/aparapi
  • Oct 23 22:12
    david-d25 starred Syncleus/aparapi
  • Oct 21 07:07
    edom71 starred Syncleus/aparapi
  • Oct 12 22:35
    Raunak-Singh-Inventor closed #168
  • Oct 12 22:35
    Raunak-Singh-Inventor closed #168
  • Oct 11 09:03
    grfrost commented #168
  • Oct 08 12:13
    treyperry starred Syncleus/aparapi
  • Oct 06 09:01
    dependabot[bot] closed #5
  • Oct 06 09:01

    dependabot[bot] on bundler

    (compare)

  • Oct 06 09:01
    dependabot[bot] commented #5
  • Oct 06 09:01
    dependabot[bot] labeled #8
  • Oct 06 09:01
    dependabot[bot] opened #8
  • Oct 06 09:01

    dependabot[bot] on bundler

    Bump addressable from 2.7.0 to … (compare)

  • Oct 03 14:25
    yqy7 starred Syncleus/aparapi
  • Oct 02 14:47
    Kevin-HYX starred Syncleus/aparapi
  • Sep 30 17:23
    dependabot[bot] labeled #170
  • Sep 30 17:23

    dependabot[bot] on maven

    Build(deps): Bump scala-library… (compare)

  • Sep 30 17:23
    dependabot[bot] opened #170
  • Sep 16 02:49
    lakxtxue starred Syncleus/aparapi
Mandeep Singh
@mandeepsingh-private
the code is unable to detect the GPU
GPU: Nvidia RTX 3080
OpenCL version: 3.0
Operating System: Pop OS (Ubuntu)
grfrost
@grfrost
@freemo do we have instructions on how to build from maven repos for @mandeepsingh-private . He has built java and C++ code before, and we may need for him to build his own aparapi.....
grfrost
@grfrost

@mandeepsingh-private try cloning and building from this

https://github.com/grfrost/javacltest

See if it builds and runs.

Matt Groth
@mgroth0
Hi how is the M1 Mac release coming along? It would be great to try this library out with my work soon. And please let me know if you'd like me to try building from source. I just will need a little guidance
grfrost
@grfrost
@mgroth0 good timing. My M1 laptop is arriving 'by the weekend' alledgedly, as soon as I get it setup I will try an Aparapi build and let you know my findings.
@mgroth0 although the repo I made for @mandeepsingh-private above, may also be interesting for you to try.
You will need to make sure you have Java, C++ dev and OpenCL. The test project at
https://github.com/grfrost/javacltest
Will ensure you have these set up....
grfrost
@grfrost

OK I got my Apple Mac Pro with M1 and have instructions for building/patching aparapi

@freemo:qoto.org let me know if you want me to send you the libaparapi_aarch64.dylib

@mgroth0 pull this repo from git and follow the README.md.

https://github.com/grfrost/aparapi-m1
Should take 10 minutes tops

@freemo the README.md also contains the patch for NativeLoader to load the aarch64 dylib

1 reply
grfrost
@grfrost

@mandeepsingh-private you might be able to rebuild and test using

https://github.com/grfrost/aparapi-m1

Build and run works for me on Apple M1 and linux x64 platforms. So hopefully it will find you NVidia CUDA OpenCL lib....

grfrost
@grfrost

@freemo I had a crash on linux. Tracked it to this.

The extra %s in the fprintf was causing grief ;)

diff --git a/src/cpp/JNIExceptions.h b/src/cpp/JNIExceptions.h
index bcb44a0..3ff72f3 100644
--- a/src/cpp/JNIExceptions.h
+++ b/src/cpp/JNIExceptions.h
@@ -51,7 +51,7 @@ public:

    void printError() {
       if(_message != "") {
-         fprintf(stderr, "!!!!!!! %s failed %s\n", message());
+         fprintf(stderr, "!!!!!!! failed %s\n", _message.c_str());^M
       }
    }

Actually we may want to check the handling of code that uses the pattern return std::string('"....").c_str() this is dangerous as we are returning a pointer from a temporary object.

Matt Groth
@mgroth0
@grfrost thanks so much. I could not build it yet, but here are my results.
First, javac was not found. So I changed the line cmake --build build --target javac --target jar to cmake --build build --target /usr/bin/javac --target jar
This helped. But then I ran into another error:
cmake --build build --target /usr/bin/javac --target jar
[  5%] Building CXX object CMakeFiles/aparapi_aarch64.dir/syncleus/aparapi-native/src/cpp/CLHelper.cpp.o
In file included from /Users/matthewgroth/registered/ide/aparapi-builder-cmake/syncleus/aparapi-native/src/cpp/CLHelper.cpp:55:
In file included from /Users/matthewgroth/registered/ide/aparapi-builder-cmake/syncleus/aparapi-native/src/cpp/CLHelper.h:57:
/Users/matthewgroth/registered/ide/aparapi-builder-cmake/syncleus/aparapi-native/src/cpp/Common.h:77:10: fatal error: 'jni.h' file not found
#include <jni.h>
         ^~~~~~~
1 error generated.
make[3]: *** [CMakeFiles/aparapi_aarch64.dir/syncleus/aparapi-native/src/cpp/CLHelper.cpp.o] Error 1
make[2]: *** [CMakeFiles/aparapi_aarch64.dir/all] Error 2
make[1]: *** [CMakeFiles/jar.dir/rule] Error 2
make: *** [jar] Error 2
grfrost
@grfrost
cmake --build build --target javac --target jar

is correct. You may need to edit the CMakeLists.txt to point JAVA_HOME (in the CMakeLists.txt) to your JDK.

We need JAVA_HOME to point to a JDK so we can find javac, java and jar . Also ${JAVA_HOME}/include is where we find jni.h. The error.

Once you change JAVA_HOME (or anything in CMakeLists.txt)

cmake build 
cmake --build build --target javac --target jar

The first line rescans the CMakeLists.txt to create the make/ninja files.

nibblyn
@nibblyn:matrix.org
[m]
I have made a simple app for fractal music.
https://github.com/betaiotazeta/FractalMusicGenerator
It is packaged with jpackage and works well for me with Nvidia 1080. Some users are complaining that the app launches, then crashes with the following message: "child process exited with code 1" when running on AMD 6900XT or Nvidia 3080. They can run the app in a virtual machine. My understanding is that Aparapi switches to JTP automatically when something is wrong with the GPU, but for those high-end cards it doesn't seem to happen and an error occurs instead. I can't debug this issue because I don't have the hardware. How should I deal with this, by testing for something when the app starts? Should I always start in JTP and then give the option to switch to GPU? Thanks for your efforts with Aparapi, have a nice day!
CoreRasurae
@CoreRasurae
@freemo @grfrost Guys, I've found a couple o crticial issues in Aparapi. In this new version 3.0.0 the mapped methods and NoCL methods wrongly trigger an assert condition in Entrypoint.getCallTarget(...) method. Secondly, for a much greater amount of time private memory space arrays are completely broken and unusable. I'll try to provide fixes for them in the next days, if I can. Plus I would also like to add support for the integer correspondent of mad, named mad24, so that I would like to make that a mapped method. Provided there is no objections from any of you. For me it is quite useful when computing indices of 2D arrays mapped as a single array. The 24 bits limitation can also be forced on the Java side through a bit mask. What do you say?
this is an urgency fix that I am trying to bring as my work is depending on this, besides that I am without a minute of free time... almost working round the clock, to get a software ready
1 reply
CoreRasurae
@CoreRasurae
boolean fields are also broken...
CoreRasurae
@CoreRasurae
I will need to publish this new software somewhere in September/October and I would like that it would go with a released version of Aparapi
Private memory arrays cannot be directly initialized from the host, and currently Aparapi sets up Kernel arguments for those, which is completely wrong. In the MRs that I will provide they will be filtered out. Plus Aparapi is currently marking private memory arrays as belonging to the constant memory space. All completely wrong. I am testing fixes for that at this moment.
grfrost
@grfrost
@CoreRasurae sounds like some good fixes. I certainly have no objections.
I am interested in how to implement the initialization of private memory. Maybe you plan on generating init code in the generated OpenCL?
Would the Mad24 code fall back to Java ok.
I have a private copy of Aparapi native code which compiles sans warnings on modern C++/Clang/Mac + Linux. It is in a set of patches applied to mainline which I have not got around to make pull requests for. If you want them, before you start let me know.
CoreRasurae
@CoreRasurae
@grfrost Yes, the private memory arrays can only be initialized in the OpenCL code itself, however those initializations are naturally translated from Java code by Aparapi. I have implemented and tested kernel running with private memory arrays and it didn't show up any issues. Yes, mad24 does have a Java implementation for it. I won't touch Aparapi-native for this changes, my MRs only touch the Java side.
grfrost
@grfrost
Nice. Thanks. Look forward to seeing the changes.
Freemo
@freemo:qoto.org
[m]
Hey just checking in, anyone need anything from me?
CoreRasurae
@CoreRasurae
@freemo:qoto.org I am testing the fixes. I hope to have a MR ready in the next two days.
Freemo
@freemo:qoto.org
[m]
@CoreRasurae: ok ill check back for that then
grfrost
@grfrost

@freemo . I have some patches collected here
https://github.com/grfrost/aparapi-builder-cmake/tree/main/patches

Mostly they suppress clang warnings, some are potential access violations I found running valgrind. The main fix https://github.com/grfrost/aparapi-builder-cmake/blob/main/patches/aparapi-jni.patch allows Aparapi to build on Apple M1 (arch64) machines. Sorry I have not pushed this back to mainline. I moved away from using Maven a long time ago, This project builds from your maven repos using cmake... I know slightly weird for Java but saves me from more grey hairs.

Freemo
@freemo:qoto.org
[m]
@grfrost: we have to find a way to get it into mainline if we are going to release it partly as a legal obligation of the license if nothing else
Perhaps @CoreRasurae is willing to work with you to make the PR on your behald
*behalf
CoreRasurae
@CoreRasurae
@freemo:qoto.org Sorry Jeffrey I have no time at this moment. I am just pushing this changes because they are critical bugs, that I ran across while working on my PhD. As result of my work I also expect to publish my software as open-source and as such it would be nice it was using a released version of Aparapi.
Freemo
@freemo:qoto.org
[m]
@CoreRasurae: understood, thanks
@grfrost: I wont have the time for a few weeks probably to do it myself. I'd really love to get the binary in to support the new macs but we really need to make sure it reflects the code base and is compiled from it for obvious security and legal reasons. Would you be willing to put the effort in to make the merge request?
grfrost
@grfrost
Yeah I am not sure it will be hard and no idea why there would be a license issue. If you clone that repo... Then the patch dir contains two patch files. Just apply (cd your repo, git apply file.patch) which will try to patch your repo. Then commit.
Freemo
@freemo:qoto.org
[m]
@grfrost: the license issue is that any code distributed as open-source must link to the code present in the binary. Since our license links to our repo if the binary has new code in it it has to be in the repo to distribute it.
@grfrost: can you do that clone, path and apply it to the repo please? Its not hard, i just dont have the time right now (critical time in the company im at for next 2 weeks)
grfrost
@grfrost
OK. I will pull the latest jni and native repos. Apply these patches and ensure that it runs (for me ;) ) then commit (assuming I have permission). Then I will pull again (sans patching) and check that my workloads run. Is that enough?
grfrost
@grfrost
Alas nyet. Permission to Syncleus/aparapi-native.git denied to grfrost.
CoreRasurae
@CoreRasurae
@freemo:qoto.org Hi, I am also having issues with my git.qoto.org account. When I login it says that my plan from gitlab.com has expired...
what can I do? do I have to do something on my side, or is it something with git.qoto.org?
CoreRasurae
@CoreRasurae
I am unable to push stuff into my repo, I can only fetch from it
freemo
@freemo:qoto.org
[m]
@CoreRasurae: give me a day or two to fix it. the license had a issue but im in contact with gitlab onn it.
CoreRasurae
@CoreRasurae
@freemo:qoto.org sure, no problem
CoreRasurae
@CoreRasurae
@freemo:qoto.org @grfrost My MR is ready to be reviewed and merged.
@freemo:qoto.org The CI stopped working again....
Freemo
@freemo:qoto.org
[m]
@CoreRasurae: i can look into the CI. did it break on its own or did you introduce breaking changes?
CoreRasurae
@CoreRasurae
@freemo:qoto.org It does not do anything at all. It fails at start. There are no API breaking changes at this moment, however when using private memory arrays there is behavioral change, but it is absolutely necessary to be OpenCL compliant. I am leaving the breaking changes associated with the Kernel, Device and Range association for another MR, at a later time. I propose that we first solve this broken stuff in Aparapi 3.0.0 before doing the badly needed breaking changes for the Kernel, Device and Range association for Aparapi 4.0.0. This way we give the users an option to progress in small steps, without needing to overhaul their code bases at once, if they just need to use NoCL annotated methods or if they need Private memory arrays.
When I say being OpenCL compliant in terms o private memory arrays I mean that we have to follow OpenCL semantics for private arrays.
CoreRasurae
@CoreRasurae
That introduces a behavioral change, with respect to previous Aparapi versions, except that previous versions were handling private memory arrays as constant memory space arrays and despite some kernels run and provide correct results, I am almost sure that OpenCL compiler moves those variables out of the constant memory space, back to global memory, since in many kernels those supposedly private variables have to be written to. Thus, despite some kernels will work, there is no performance gain, thus diverging from the expected.