gpu-dawn: linux aarch64 support #194

Closed
opened 2022-03-29 01:51:52 +00:00 by LaPingvino · 18 comments
LaPingvino commented 2022-03-29 01:51:52 +00:00 (Migrated from github.com)

While trying to run zig build run-example on Debian ARM64 in a Chromebook Crostini VM I get:

error: gpu-dawn binaries for aarch64-linux.5.10.92...5.10.92-gnu.2.33 not available.
error: -> open an issue: https://github.com/hexops/mach/issues
error: -> build from source (takes 5-15 minutes):
error:        use -Ddawn-from-source=true or set `Options.from_source = true`

and adding -Ddawn-from-source=true to this command or trying to set from_source to true any other way doesn't fix it.

While trying to run `zig build run-example` on Debian ARM64 in a Chromebook Crostini VM I get: ``` error: gpu-dawn binaries for aarch64-linux.5.10.92...5.10.92-gnu.2.33 not available. error: -> open an issue: https://github.com/hexops/mach/issues error: -> build from source (takes 5-15 minutes): error: use -Ddawn-from-source=true or set `Options.from_source = true` ``` and adding -Ddawn-from-source=true to this command or trying to set from_source to true any other way doesn't fix it.
LaPingvino commented 2022-03-29 02:02:19 +00:00 (Migrated from github.com)

Update: when going directly in the libs directory version of mach-gpu-dawn, it does accept the dawn-from-source option as in zig build -Ddawn-from-source=true, it's just not passed on from running the example. Now sleep, will try more later.

Update: when going directly in the libs directory version of mach-gpu-dawn, it does accept the dawn-from-source option as in `zig build -Ddawn-from-source=true`, it's just not passed on from running the example. Now sleep, will try more later.
emidoots commented 2022-03-29 08:44:15 +00:00 (Migrated from github.com)

Thanks for filing! I filed https://github.com/hexops/mach/issues/196 for the dawn-from-source=true bug.

Currently, aarch64-linux is not supported, I'd like to get it working soon and it shouldn't be too hard. What needs to be done:

  1. Create a repository like https://github.com/hexops/sdk-linux-x86_64 but fetching aarch64 packages instead of x86_64 ones.
  2. Enable use of that repo [in system_sdk.zig](https://github.com/hexops/mach/blob/a2f65d
    5a231eebf1be120ba7d904675f08e1464f/glfw/system_sdk.zig#L47-L49)
  3. Make gpu-dawn/'s CI pipeline produce builds for aarch64
  4. Update gpu-dawn/build.zig to utilize those binary releases github.com/hexops/mach@a2f65d5a23/gpu-dawn/build.zig (L194)
Thanks for filing! I filed https://github.com/hexops/mach/issues/196 for the `dawn-from-source=true` bug. Currently, aarch64-linux is not supported, I'd like to get it working soon and it shouldn't be too hard. What needs to be done: 1. [x] Create a repository like https://github.com/hexops/sdk-linux-x86_64 but fetching aarch64 packages instead of x86_64 ones. 2. [x] Enable use of that repo [in system_sdk.zig](https://github.com/hexops/mach/blob/a2f65d 5a231eebf1be120ba7d904675f08e1464f/glfw/system_sdk.zig#L47-L49) 3. [ ] Make gpu-dawn/'s [CI pipeline](https://github.com/hexops/mach/blob/main/gpu-dawn/.github/workflows/ci.yml) produce builds for aarch64 4. [ ] Update `gpu-dawn/build.zig` to utilize those binary releases https://github.com/hexops/mach/blob/a2f65d5a231eebf1be120ba7d904675f08e1464f/gpu-dawn/build.zig#L194
mitchellh commented 2022-03-30 15:56:28 +00:00 (Migrated from github.com)

For step one: https://github.com/mitchellh/mach-sdk-linux-aarch64 Feel free to grab that and pull it into the hexops org.

For step one: https://github.com/mitchellh/mach-sdk-linux-aarch64 Feel free to grab that and pull it into the `hexops` org.
mitchellh commented 2022-03-30 18:18:02 +00:00 (Migrated from github.com)

Fwiw, with the two steps already taken, you can now run zig build run-dawn-example -Ddawn-from-source=true in the gpu-dawn directory and this all just works on aarch64 Linux. I tested locally. Hopefully binary builds can come though :)

Fwiw, with the two steps already taken, you can now run `zig build run-dawn-example -Ddawn-from-source=true` in the `gpu-dawn` directory and this all just works on aarch64 Linux. I tested locally. Hopefully binary builds can come though :)
emidoots commented 2022-03-30 18:59:21 +00:00 (Migrated from github.com)

Plan for binary builds: GitHub actions doesn't have ARM runners, but we can just cross-compile. Should be easy, I'll get this working within a few days.

Plan for binary builds: GitHub actions doesn't have ARM runners, but we can just cross-compile. Should be easy, I'll get this working within a few days.
kamidev commented 2022-06-07 14:03:41 +00:00 (Migrated from github.com)

I tried but couldn't build 'run-dawn-example' from source on a Raspberry PI 400 (Ubuntu 22). I have a working zig environment there and can cross-compile simple stuff. But the Dawn build stops with a bunch of errors complaining about undefined atomics symbols:

ld.lld: error: undefined symbol: __aarch64_ldadd8_rel
> referenced by atomic:1082 (/usr/bin/lib/zig/libcxx/include/atomic:1082)

Other people have reported similar problems here: https://github.com/ziglang/zig/issues/10086#

I tried but couldn't build 'run-dawn-example' from source on a Raspberry PI 400 (Ubuntu 22). I have a working zig environment there and can cross-compile simple stuff. But the Dawn build stops with a bunch of errors complaining about undefined atomics symbols: ``` ld.lld: error: undefined symbol: __aarch64_ldadd8_rel > referenced by atomic:1082 (/usr/bin/lib/zig/libcxx/include/atomic:1082) ``` Other people have reported similar problems here: https://github.com/ziglang/zig/issues/10086#
kamidev commented 2022-06-23 09:45:01 +00:00 (Migrated from github.com)

There is an open PR which may solve the atomics issues with linux aarch64: https://github.com/ziglang/zig/pull/11828#. Hopefully it will be merged eventually.

There is an open PR which may solve the atomics issues with linux aarch64: https://github.com/ziglang/zig/pull/11828#. Hopefully it will be merged eventually.
emidoots commented 2023-06-18 21:15:08 +00:00 (Migrated from github.com)

In theory this probably all works now, but I don't think anyone has tested it / confirmed it does.

Getting an aarch64-linux machine to test on has been very annoying, I had bought a ROCK pi 5B for this but just last week it randomly died and I don't know why (nvme failure perhaps.)

If someone can test it works or not, that'd be helpful information in pushing support of this along.

In theory this probably all works now, but I don't think anyone has tested it / confirmed it does. Getting an aarch64-linux machine to test on has been very annoying, I had bought a ROCK pi 5B for this but just last week it randomly died and I don't know why (nvme failure perhaps.) If someone can test it works or not, that'd be helpful information in pushing support of this along.
emidoots commented 2023-06-18 21:17:12 +00:00 (Migrated from github.com)

The way to test:

git clone https://github.com/hexops/mach
cd mach/libs/gpu
zig build run-example
The way to test: ``` git clone https://github.com/hexops/mach cd mach/libs/gpu zig build run-example ```
LaPingvino commented 2023-06-19 12:23:00 +00:00 (Migrated from github.com)
/home/ikojba/mach/libs/gpu/libs/mach-gpu-dawn/sdk.zig:225:54: error: root struct of file 'builtin' has no member named 'Version'
/home/ikojba/mach/libs/gpu/libs/mach-glfw/system_sdk.zig:46:29: error: missing struct field: patch
/home/ikojba/zig-linux-aarch64-0.11.0-dev.3704+729a051e9/lib/std/SemanticVersion.zig:1:1: note: struct declared here

Suspect that might be an issue with running on the nightly? Otherwise it doesn't show the previous issue anymore.

``` /home/ikojba/mach/libs/gpu/libs/mach-gpu-dawn/sdk.zig:225:54: error: root struct of file 'builtin' has no member named 'Version' /home/ikojba/mach/libs/gpu/libs/mach-glfw/system_sdk.zig:46:29: error: missing struct field: patch /home/ikojba/zig-linux-aarch64-0.11.0-dev.3704+729a051e9/lib/std/SemanticVersion.zig:1:1: note: struct declared here ``` Suspect that might be an issue with running on the nightly? Otherwise it doesn't show the previous issue anymore.
alichraghi commented 2023-06-19 12:32:12 +00:00 (Migrated from github.com)

added to #811

added to #811
LaPingvino commented 2023-06-19 12:54:02 +00:00 (Migrated from github.com)

with 0.10.1 I get /home/ikojba/mach/libs/gpu/build.zig:7:21: error: root struct of file 'std' has no member named 'Build'

with 0.10.1 I get `/home/ikojba/mach/libs/gpu/build.zig:7:21: error: root struct of file 'std' has no member named 'Build'`
alichraghi commented 2023-06-19 13:42:14 +00:00 (Migrated from github.com)

mach tracks master so 0.10.1 shouldn't work at all. all you have to do is changing std.builtin.Version to std.SemanticVersion in this line

-- const min_available = std.builtin.Version{ .major = 12, .minor = 0 };
++ const min_available = std.SemanticVersion{ .major = 12, .minor = 0 };
mach tracks master so `0.10.1` shouldn't work at all. all you have to do is changing `std.builtin.Version` to `std.SemanticVersion` in this [line](https://github.com/hexops/mach/blob/4430ce08ec4566d247a1db553135270f19d1f15e/libs/gpu-dawn/sdk.zig#L225) ```diff -- const min_available = std.builtin.Version{ .major = 12, .minor = 0 }; ++ const min_available = std.SemanticVersion{ .major = 12, .minor = 0 }; ```
LaPingvino commented 2023-06-19 14:18:53 +00:00 (Migrated from github.com)

Now just some "Missing struct field: .patch" errors...

Now just some "Missing struct field: .patch" errors...
alichraghi commented 2023-06-19 15:12:52 +00:00 (Migrated from github.com)

std.SemanticVersion{ .major = 12, .minor = 0, .patch = 0 };

`std.SemanticVersion{ .major = 12, .minor = 0, .patch = 0 };`
LaPingvino commented 2023-06-21 01:15:26 +00:00 (Migrated from github.com)

After fixing #811 this seems to work flawlessly :D

After fixing #811 this seems to work flawlessly :D
emidoots commented 2023-06-21 04:58:06 +00:00 (Migrated from github.com)

Works as in you ran on an arm device and saw graphics?

Works as in you ran on an arm device and saw graphics?
LaPingvino commented 2023-06-21 10:01:36 +00:00 (Migrated from github.com)

Yes, exactly that!

On June 21, 2023 at 4:58 GMT, Stephen Gutekanst @.***> wrote:

Works as in you ran on an arm device and saw graphics?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you modified the open/close state.Message ID: @.***>

Yes, exactly that! On June 21, 2023 at 4:58 GMT, Stephen Gutekanst ***@***.***> wrote: Works as in you ran on an arm device and saw graphics? — Reply to this email directly, [view it on GitHub](https://github.com/hexops/mach/issues/194#issuecomment-1600073113), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAACQNTRQ6M6MPNKW4I5MDLXMJ5OTANCNFSM5R44F2AQ). You are receiving this because you modified the open/close state.Message ID: ***@***.***>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach#194
No description provided.