AArch64 support

678 views
Skip to first unread message

vojtec...@avast.com

unread,
Nov 4, 2016, 11:41:35 AM11/4/16
to swiftshader
Hello,
I'm currently working on running Android emulators natively with KVM on AArch64 server board. While I have all the other parts working, I'm still struggling with the GPU acceleration. Using the "host" gpu won't work for me, since I'm unable to even bring up X server on my Mustang board (it kinda seems nobody really tried to use it with external GPU). Mesa backend is gonna be deprecated soon, too, so I'd love to use Swiftshader.

Swiftshader however seems to be written for x86 only. Is porting it for aarch64 is even feasible, and if so, can you give me a few starting pointers?

Thank you.

Nicolas Capens

unread,
Nov 4, 2016, 1:26:25 PM11/4/16
to vojtec...@avast.com, swiftshader
Hi Vojtech,

We've started to evaluate how to support AArch64 ourselves as well. :-) The real challenge is to produce ARM64 code from Reactor. Currently we're using LLVM's JIT-compiler, but it's a very old version which doesn't support ARM64. So the first task would be to upgrade it to a newer version.

However, I'm currently working on using Subzero, the compiler from the Portable Native Client project, as an alternative JIT. It's much smaller and faster. I've got it to compile on a Jetson TX1 system, but Subzero currently only supports ARM32 for now. For us a lot will depend on just how successful the use of Subzero will be. If I can get it to produce equivalent (x86) code quality to LLVM, then I'll probably deprecate LLVM and ARM64 support will have to be added to Subzero. But we don't have a timeline for when that might happen.

Is upgrading LLVM something you would be interested in undertaking? Once that's done I'd be happy to help replace the use of x86 intrinsics with ARM64 equivalents.

Cheers,
Nicolas

--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader+unsubscribe@googlegroups.com.
To post to this group, send email to swift...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/003c0205-30e5-484b-aa95-822486642384%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vojtec...@avast.com

unread,
Nov 7, 2016, 6:27:50 AM11/7/16
to swiftshader
Hey,
thanks for your response! I think I'm gonna try updating the LLVM, but I'm not promising anything - while this is bloody interesting, it's not the only thing I'm supposed to be working on, and I don't really know anything about Swiftshader or LLVM, other than what they're for.


On Friday, November 4, 2016 at 6:26:25 PM UTC+1, Nicolas Capens wrote:
Hi Vojtech,

We've started to evaluate how to support AArch64 ourselves as well. :-) The real challenge is to produce ARM64 code from Reactor. Currently we're using LLVM's JIT-compiler, but it's a very old version which doesn't support ARM64. So the first task would be to upgrade it to a newer version.

However, I'm currently working on using Subzero, the compiler from the Portable Native Client project, as an alternative JIT. It's much smaller and faster. I've got it to compile on a Jetson TX1 system, but Subzero currently only supports ARM32 for now. For us a lot will depend on just how successful the use of Subzero will be. If I can get it to produce equivalent (x86) code quality to LLVM, then I'll probably deprecate LLVM and ARM64 support will have to be added to Subzero. But we don't have a timeline for when that might happen.

Is upgrading LLVM something you would be interested in undertaking? Once that's done I'd be happy to help replace the use of x86 intrinsics with ARM64 equivalents.

Cheers,
Nicolas
On Fri, Nov 4, 2016 at 11:41 AM, <vojtec...@avast.com> wrote:
Hello,
I'm currently working on running Android emulators natively with KVM on AArch64 server board. While I have all the other parts working, I'm still struggling with the GPU acceleration. Using the "host" gpu won't work for me, since I'm unable to even bring up X server on my Mustang board (it kinda seems nobody really tried to use it with external GPU). Mesa backend is gonna be deprecated soon, too, so I'd love to use Swiftshader.

Swiftshader however seems to be written for x86 only. Is porting it for aarch64 is even feasible, and if so, can you give me a few starting pointers?

Thank you.

--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader...@googlegroups.com.

vojtec...@avast.com

unread,
Nov 8, 2016, 8:16:18 AM11/8/16
to swiftshader
Hello again,
after noticing that LLVM has removed the JIT swiftshader uses and how much digging would updating it be, I kinda gave up. Especially because I just tried to compile Mesa llvmpipe renderer, and it just works with the emulator.

Do you know what the reason was to switch from Mesa to Swiftshader? Was it performance? To me, it seems that both swiftshader and llvmpipe in Mesa are doing kinda the same thing.

Nicolas Capens

unread,
Nov 8, 2016, 2:14:19 PM11/8/16
to vojtec...@avast.com, swiftshader
On Tue, Nov 8, 2016 at 8:16 AM, <vojtec...@avast.com> wrote:
Hello again,
after noticing that LLVM has removed the JIT swiftshader uses and how much digging would updating it be, I kinda gave up.

Yeah, we'd have to use the MCJIT now. The Fibonacci sample nicely illustrates how to use it, but it's not exactly trivial. It's part of the reason we haven't updated LLVM in years (another major reason is binary size bloat). Anyway, I fully understand if you don't have the time to look into it.

Especially because I just tried to compile Mesa llvmpipe renderer, and it just works with the emulator.

Do you know what the reason was to switch from Mesa to Swiftshader? Was it performance? To me, it seems that both swiftshader and llvmpipe in Mesa are doing kinda the same thing.

SwiftShader passes the Android graphics conformance test suite (dEQP). The goal is to have "certified" emulated devices. Mesa llvmpipe is nowhere near passing conformance, and crashes on some occasions. We have the in-house expertise to keep SwiftShader stable and extend its functionality (OpenGL ES 3.0 is almost ready), while working on Mesa is convoluted due to it also acting as a GPU driver, and requiring external reviews.

On top of that, SwiftShader is indeed faster. I've seen anywhere from 50% to 3x, and there's more to come.

Anyway, it's interesting that you had no trouble getting llvmpipe to run on AArch64. That's a bit of healthy competition to motivate me to also port SwiftShader to ARM. :-)

On Monday, November 7, 2016 at 12:27:50 PM UTC+1, vojtec...@avast.com wrote:
Hey,
thanks for your response! I think I'm gonna try updating the LLVM, but I'm not promising anything - while this is bloody interesting, it's not the only thing I'm supposed to be working on, and I don't really know anything about Swiftshader or LLVM, other than what they're for.

On Friday, November 4, 2016 at 6:26:25 PM UTC+1, Nicolas Capens wrote:
Hi Vojtech,

We've started to evaluate how to support AArch64 ourselves as well. :-) The real challenge is to produce ARM64 code from Reactor. Currently we're using LLVM's JIT-compiler, but it's a very old version which doesn't support ARM64. So the first task would be to upgrade it to a newer version.

However, I'm currently working on using Subzero, the compiler from the Portable Native Client project, as an alternative JIT. It's much smaller and faster. I've got it to compile on a Jetson TX1 system, but Subzero currently only supports ARM32 for now. For us a lot will depend on just how successful the use of Subzero will be. If I can get it to produce equivalent (x86) code quality to LLVM, then I'll probably deprecate LLVM and ARM64 support will have to be added to Subzero. But we don't have a timeline for when that might happen.

Is upgrading LLVM something you would be interested in undertaking? Once that's done I'd be happy to help replace the use of x86 intrinsics with ARM64 equivalents.

Cheers,
Nicolas

On Fri, Nov 4, 2016 at 11:41 AM, <vojtec...@avast.com> wrote:
Hello,
I'm currently working on running Android emulators natively with KVM on AArch64 server board. While I have all the other parts working, I'm still struggling with the GPU acceleration. Using the "host" gpu won't work for me, since I'm unable to even bring up X server on my Mustang board (it kinda seems nobody really tried to use it with external GPU). Mesa backend is gonna be deprecated soon, too, so I'd love to use Swiftshader.

Swiftshader however seems to be written for x86 only. Is porting it for aarch64 is even feasible, and if so, can you give me a few starting pointers?

Thank you.

--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader...@googlegroups.com.
To post to this group, send email to swift...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/003c0205-30e5-484b-aa95-822486642384%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader+unsubscribe@googlegroups.com.

To post to this group, send email to swift...@googlegroups.com.

vojtec...@avast.com

unread,
Nov 9, 2016, 4:35:57 AM11/9/16
to swiftshader
Hey,
thank you for the insight, it's really interesting! I'll be keeping an eye on Swiftshader, and use Mesa for now - it seems to be working fine with pretty much just vanilla 13.0.0 build, but so far, I've done only the initial testing, and still have to get everything into some commitable state - you can probably imagine how totally-not-hacky-at-all-I-swear the build is when the original emulator build files know only x86[_64] and are using prebuilt binaries. Also, Aarch64 server boards are unreasonably difficult to come by, so I only have one to test on :(

Nicolas Capens

unread,
Nov 9, 2016, 8:04:15 AM11/9/16
to vojtec...@avast.com, swiftshader

I got a Jetson TX1 to develop on. Liking it quite a bit so far. https://twitter.com/c0d1f1ed/status/791664375006388225


To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader+unsubscribe@googlegroups.com.

To post to this group, send email to swift...@googlegroups.com.

yao gang

unread,
Aug 13, 2018, 9:59:17 AM8/13/18
to swiftshader
Hello Nicolas, 

  I am just wondering is there any update on this thread. Basically can the swift shader can be targeted for ARM architecture? I noticed Subzero has been included however no idea whether the whole stuff works or not? 


Regards
Yao 

Nicolas Capens

unread,
Aug 29, 2018, 11:18:38 PM8/29/18
to nobo...@gmail.com, swiftshader
Hi Yao,

Sorry for the late reply. ARMv7 has been supported for a while now, and work for ARMv8 support will start soon.

Cheers,
Nicolas

yao gang

unread,
Aug 30, 2018, 3:35:26 AM8/30/18
to Nicolas Capens, swiftshader
Hello Nicolas,

Thanks for the reply.  I have to build from the source I assume.  Are there some documents which can help me to get started? I did not find a precomoiled image in the git hub directory. 

Regards
Yao

Nicolas Capens

unread,
Aug 31, 2018, 5:39:47 PM8/31/18
to nobo...@gmail.com, Nicolas Capens, swift...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages