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

Build artifact and release assets #13

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

henning-gerhardt
Copy link
Contributor

@henning-gerhardt henning-gerhardt commented Nov 30, 2024

This pull request may superseed #12.

Instead of running two workflows and two possible different builds the created files from the CI workflow are used to create even the release builds assets. Benefit is that every build now create all artifacts assets for every operation system so even without a release every one on every supported operation system can try the most recent version out without the need to build mfakto itself.

I discovered too how to build the artifact and release assert on windows-msvc. This can even be pack ported to #12 if two independent build workflows should be used.

I could only test the created Linux based assets in a successful way, so Windows and MacOS should be tested who can access them.

Edit:

@henning-gerhardt
Copy link
Contributor Author

With the latest change I created a new test tag https://github.com/henning-gerhardt/mfakto/releases/tag/v0.0.3.

The build artifacts are available under https://github.com/primesearch/mfakto/actions/runs/12095551380 for the latest changes of this pull request. After this change is merged they are available under https://github.com/primesearch/mfakto/actions -> Commit name -> Artifacts

@jcoxdco
Copy link

jcoxdco commented Dec 7, 2024

I pulled down mfakto-v0.0.2-windows-msvc. Self tests passed. Windows 11, RDNA3 7700 XT.
I didn't finish the TF of that exponent. I can if you think it is needed.

image

@henning-gerhardt
Copy link
Contributor Author

Thank you for testing this build, jcoxdco. I'm hoping that the builds are helping everyone who want to use mfakto.

uses: actions/upload-artifact@v4
with:
name: mfakto-windows-msvc
path: x64/Debug/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this package the debug build? I believe the release build would a better choice, especially for the users who download the binary without the sources.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the debug build was in place which I used. A release build should be possible too. I must try it how to do this as I have only GitHub to build the Windows build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adjusted the build process to use a release build. I'm hoping this is working. Can someone please test it? Build should be available in a few minutes.

if: startsWith(github.ref, 'refs/tags/')
with:
files: |
mfakto-windows-msys2.zip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for making two different builds for Windows available for download? The CI script checks two documented ways to build mfakto for Windows. Developers would care, as they use one or another. But why should the end users care?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. I did only extending the existing builds. Which version is the better one on Windows?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be tested. Generally, the faster version should be used. If there is no significant difference in speed, I would go with MSYS2 because it's open source and because it shares the build system with Linux (the same compiler, the same compiler flags).

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: mfakto-${{ matrix.os }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I downloaded mfakto-macos-13.zip and tried running it on a Mac. I got

Select device - Error: No platform found
ERROR: init_CL(3, 0) failed

That can be expected, as the binary is linked against pocl rather than against the MacOS OpenCL library. I believe separate builds would be needed to test mfakto with pocl and to distribute mfakto that uses the actual OpenCL.

Also, the binary names are misleading. The main difference between macos-13 and macos-14 on GitHub is that macos-13 is x86_64 and macos-14 is aarch64. It might be possible to make a fat binary to support both architectures.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You error message is good to know. How did the previous executed test success on GitHub but not on your system? I'm familiar only with Linux and do only guessing how it could work on Windows and MacOS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the mfakto version compiled against pocl would look for pocl. If pocl is not installed, mfakto won't fall back to the native OpenCL drivers. The only reason to use pocl is to run tests without any GPUs. The users who download the binary are expected to have a GPU and are not expected to have pocl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the pocl dependency from MacOS build but without this dependency the executed tests on MacOS on GitHub did not work anymore. For Windows builds there are no tests executed too so it should be okay for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need two different builds, one for testing and another for distribution. We can only avoid it if it's possible to use the OpenCL linked binaries to use pocl at the runtime, but I read somewhere that it's impossible on MacOS, so I didn't try.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see 3 possible options:

  1. use the current version as is without test execution on the MacOS builds
  2. use different builds for CI and making the builds file available. But this has 2 disadvantages: more files to maintain and if the CI build is failing then the other build will be continue
  3. extend the current CI build for MacOS: Build with the pocl dependency and execute the tests. Then additional make clean run and a normal make run without the pocl dependency and use this build for the downloadable files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The number 3 would be the best.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try option 3 but this must wait a few days as I'm now on vacation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back from vacation and I adjusted the MacOS build with option 3: additional make clean run and a make run without the pocl dependency in use.

@proski can you verify that both MacOS executables are now correct build? They are available at https://github.com/henning-gerhardt/mfakto/actions/runs/12893233610#artifacts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can confirm that the macos-13 build is working on an Intel iMac with a Radeon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants