xamarin 部署到设备时没有硬件加速 [英] xamarin no hardware acceleration when deployin to device

查看:43
本文介绍了xamarin 部署到设备时没有硬件加速的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在开发一个 xamarin 表单应用程序,但我在硬件加速方面遇到了一些问题.

I am developing a xamarin forms application right now and I have some problems with hardware acceleration.

具体来说,在android模拟器中,硬件加速是有效的,即

Specifically, in the android emulator, hardware acceleration works, ie

System.Numerics.Vector.IsHardwareAccelerated

返回真.

然而,在设备上,它返回 false,因此像 ImageSharp 这样的库超级慢.

On the device however, it returns false, and thus libraries like ImageSharp are super slow.

我已经检查了构建设置,并且到处都检查了优化代码".另外,我在 android 项目的 MainActivity.cs 中添加了 HardwareAccelerated = true,但这并没有改变任何东西.

I already checked the build settings and "Optimize code" is checked everywhere. Also I added HardwareAccelerated = true to the MainActivity.cs in the android project, but that doesn't change anything.

有人可以帮忙吗?

模拟器在 api 级别 25 (android 7.1) 上运行,在模拟器中它正在使用调试配置.

The emulator is running on api level 25 (android 7.1), in the emulator it is working with debug configuration.

该设备正在运行 android 8.1,api 级别 27,并且只在那里发布构建工作.

The device is running android 8.1, api level 27, and only release build work there at all.

根据@SushiHangover 的说法,在 Mono 中实现的 arm 平台的 System.Numerics.Vector 没有硬件加速支持.另外,请参见此处:https://github.com/SixLabors/ImageSharp/issues/94

According to @SushiHangover there is no Hardware acceleration support for System.Numerics.Vector for arm platforms implemented in Mono. Also, see here: https://github.com/SixLabors/ImageSharp/issues/94

干杯,约翰内斯

推荐答案

我快速浏览了 Mono 的 mini-XXX.c 文件和 mini-arm.cmini-arm64.c 没有实现任何 SIMD 版本.

I did a quick scan of Mono's mini-XXX.c files and mini-arm.c and mini-arm64.c do not implement any SIMD versions.

由于没有内在支持,Mono JIT'er 不会在支持的 ARM 设备上映射 SIMD (NEON) 函数.

Since there are no intrinsic support, the Mono JIT'er will not map SIMD (NEON) functions on supported ARM devices.

注意:只有 mini-amd64.c &mini-x86.c 在 Mono Runtime/JIT 中具有对 SIMD (SSE) 的 JIT 内在支持.

Note: Only mini-amd64.c & mini-x86.c have JIT intrinsic support for SIMD (SSE) within the Mono Runtime/JIT.

注意:根据旧的 Mono 发行说明之一,通过 LLVM 的 AOT 应该在任何受支持的平台上为您提供 SIMD 支持......(我没有测试过)

Note: According to one of the old Mono release notes, AOT'ing via LLVM should give you SIMD support on any supported platform... (I have not tested that)

更新:我测试了 llvm 并且在 ARM 平台上生成的 libaot-System.Numerics.Vectors.dll.so 不是硬件加速的

Update: I tested llvm and the generated libaot-System.Numerics.Vectors.dll.so on ARM platforms is not hardware accelerated

这篇关于xamarin 部署到设备时没有硬件加速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆