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 failure for libvpx on ARMv8 with 32-bit Linux OS: Inlining failed in call to NEON instructions #30914

Closed
gexpult opened this issue Jul 29, 2019 · 26 comments · Fixed by #53833

Comments

@gexpult
Copy link

gexpult commented Jul 29, 2019

Godot version:

Latest source from master branch at GitHub (3.1)

OS/device including version:

Ubuntu 18.04 Bionic LXDE
Rock64 (ARM v8)

Issue description:

Using
scons platform=x11 tools=no target=release_debug bits=32

Expected: Godot compiles successfully.

Actual: GCC inline

[Initial build] Compiling ==> thirdparty/libvpx/vp8/common/arm/neon/bilinearpredict_neon.c
In file included from thirdparty/libvpx/vp8/common/arm/neon/bilinearpredict_neon.c:11:0:
thirdparty/libvpx/vp8/common/arm/neon/bilinearpredict_neon.c: In function 'vp8_bilinear_predict8x4_neon':
/usr/lib/gcc/arm-linux-gnueabihf/7/include/arm_neon.h:10303:1: error: inlining failed in call to always_inline 'vld1_u8': target specific option mismatch
 vld1_u8 (const uint8_t * __a)
 ^~~~~~~
thirdparty/libvpx/vp8/common/arm/neon/bilinearpredict_neon.c:42:15: note: called from here
         d26u8 = vld1_u8(src_ptr);
         ~~~~~~^~~~~~~~~~~~~~~~~~
In file included from thirdparty/libvpx/vp8/common/arm/neon/bilinearpredict_neon.c:11:0:
/usr/lib/gcc/arm-linux-gnueabihf/7/include/arm_neon.h:10303:1: error: inlining failed in call to always_inline 'vld1_u8': target specific option mismatch
 vld1_u8 (const uint8_t * __a)
 ^~~~~~~
thirdparty/libvpx/vp8/common/arm/neon/bilinearpredict_neon.c:41:15: note: called from here
         d25u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;

Steps to reproduce:
Install LXDE desktop for Rock64.
Install Godot required libraries.
Attempt to compile Godot, as above.

Minimal reproduction project:

@akien-mga
Copy link
Member

Could you paste the output of lscpu? It sounds like this board doesn't support NEON instructions.

@akien-mga akien-mga changed the title Cannot compile. Inlining failed in call to always_inline Build failure on Rock64 (ARMv8): Inlining failed in call to NEON instructions Jul 29, 2019
@gexpult
Copy link
Author

gexpult commented Jul 29, 2019

Sure. I don't know if it matters but I am considering retrying this with a 64-bit install. I noticed my OS was a 32-bit version.

`

$ lscpu
Architecture: aarch64
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Vendor ID: ARM
Model: 4
Model name: Cortex-A53
Stepping: r0p4
CPU max MHz: 1296.0000
CPU min MHz: 408.0000
BogoMIPS: 48.00
Flags: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm aes pmull sha1 sha2 crc32

@akien-mga
Copy link
Member

Sure. I don't know if it matters but I am considering retrying this with a 64-bit install. I noticed my OS was a 32-bit version.

That might play a role indeed, I'm not sure Godot's buildsystem expects a 32-bit OS on ARMv8.

@akien-mga
Copy link
Member

There are various issues in modules/webm/libvpx/SCsub regarding the handling of ARM platforms on X11. It was written at a time where ARMv8 running non-Android Linux was anecdotal, so it assumes that ARM + x11 + bits=32 means armv7hl and thus neon.

This should likely be fixed, but in the meantime, I don't really see why you would want to build 32-bit binaries on ARMv8 (if it's to run them on ARMv7, I'm not sure that would work given the different instruction sets, you might have to cross-compile instead).

@gexpult
Copy link
Author

gexpult commented Jul 29, 2019

Thanks. Yes, I didn't actually intend to use a 32-bit OS image. I'm on the 64-bit one, now. It's minimal, so I need to install X11, etc.

@gexpult
Copy link
Author

gexpult commented Jul 29, 2019

Everything compiled and I was able to run a quick test. :)

@akien-mga
Copy link
Member

Great :) I'll reduce priority for this issue as solving 32-bit support on ARMv8 is a corner case, but it would be nice to do it eventually so let's keep it open.

@akien-mga akien-mga removed this from the 3.2 milestone Jul 29, 2019
@akien-mga akien-mga changed the title Build failure on Rock64 (ARMv8): Inlining failed in call to NEON instructions Build failure for libvpx on ARMv8 with 32-bit OS: Inlining failed in call to NEON instructions Jul 29, 2019
@akien-mga akien-mga changed the title Build failure for libvpx on ARMv8 with 32-bit OS: Inlining failed in call to NEON instructions Build failure for libvpx on ARMv8 with 32-bit Linux OS: Inlining failed in call to NEON instructions Jul 29, 2019
@gexpult
Copy link
Author

gexpult commented Jul 29, 2019

Thanks :) It was fun to see Godot working on this little board. Unfortunately, the mesa build doesn't seem to support Mali, so the rendering was all via software (LLVM-pipe). The most recent mesa may support it. The Mali driver is there (glmark2-es2 for example, can use it) but mesa can't load it and reports an error.

@linky00
Copy link

linky00 commented May 1, 2020

FWIW, this not working right now is a problem for building on the Raspberry Pi, where the main OS Raspbian flat out refuses to switch to 64 bit (you can switch the kernel, but not the userland).

@Calinou
Copy link
Member

Calinou commented May 1, 2020

@linky00 You can pass module_webm_enabled=no to the SCons command line to disable WebM support. It's too slow to be usable on ARM SBCs anyway, even at low resolutions.

If we add official ARM Linux support in the future, we'll probably do this by default.

@linky00
Copy link

linky00 commented May 1, 2020

@Calinou Oh no, WebM was what I wanted to use it for!!

@Calinou
Copy link
Member

Calinou commented May 1, 2020

@linky00 Does the Raspberry Pi have hardware acceleration for VP8/VP9? If not, it's pretty much a lost cause. If it does, it would be too difficult to integrate into Godot due to licensing issues (FFmpeg is LGPL-licensed).

There's a third-party module that integrates FFmpeg into Godot, but I don't know if it can be made to work on ARM Linux.

@linky00
Copy link

linky00 commented May 1, 2020

@Calinou Can I trust ogg to work well enough in this case then?

@Calinou
Copy link
Member

Calinou commented May 1, 2020

@linky00 It can work, but I'd expect it to be slow at higher resolutions still.

@Calinou
Copy link
Member

Calinou commented Aug 25, 2020

This was confirmed on https://godotforums.org/discussion/23832/building-for-x11-fails-arm-chipset.

We should detect the target architecture in SCons to disable the WebM module automatically when not targeting an x86-based architecture.

@The-Sapphire-Starship
Copy link

i was hoping to not need to get a new os in order to do this :( guess ill have to do it

@The-Sapphire-Starship
Copy link

is there a 64 bit os anyone recommends?

@Calinou
Copy link
Member

Calinou commented Apr 9, 2021

i was hoping to not need to get a new os in order to do this :( guess ill have to do it

I don't understand the question – why would you need a new OS to do this? The SCons option I mentioned works on any OS.

@The-Sapphire-Starship
Copy link

The-Sapphire-Starship commented Apr 9, 2021

i was hoping to not need to get a new os in order to do this :( guess ill have to do it

I don't understand the question – why would you need a new OS to do this? The SCons option I mentioned works on any OS.

I did what you said and it continued compiling for a while then ran into another error, looking at the comments above it looks like my os being 32 one might be playing a role in that(even if this is not this case I might still change os to a 64 bit one because of some other possible advantages)

@Calinou
Copy link
Member

Calinou commented Apr 9, 2021

@The-Sapphire-Starship If you just want to use Godot, you can use those precompiled binaries which were compiled on a 32-bit system.

@The-Sapphire-Starship
Copy link

The-Sapphire-Starship commented Apr 9, 2021

@Calinou I know of those and ive been using them, i just want to be able to compile godot on my own so i dont have to rely on someone else compiling them for me(plus i enjoy the learning experience)

@The-Sapphire-Starship
Copy link

I switched to ubuntu 20.10 and after a while of compiling it had this error:
Screenshot from 2021-04-09 19-49-44

@Calinou
Copy link
Member

Calinou commented Apr 10, 2021

@The-Sapphire-Starship See #45687.

@The-Sapphire-Starship
Copy link

@The-Sapphire-Starship See #45687.

thanks, ill try that out later, im currently working on switching back to a 32 bit os(twister) since there are not many things(most of the things that i want) that work on 64 bit

@The-Sapphire-Starship
Copy link

Im sorry for all the comments but when run into an error i have no idea how to fix it myself.
I rand this command: scons platform=x11 module_webm_enabled=no arch=arm64
and after a long time of compiling it ran into this error:
Screenshot_2021-04-10_14-10-37

@The-Sapphire-Starship
Copy link

The-Sapphire-Starship commented Apr 11, 2021

I tweaked around a few parameters and was able to get godot to compile without errors with this command, thanks to everyone who has helped me figure this out:
scons platform=x11 tools=yes target=release_debug CCFLAGS="-mtune=cortex-a72 -mcpu=cortex-a72 -mfloat-abi=hard -mlittle-endian -munaligned-access -mfpu=neon-fp-armv8" -j4 module_webm_enabled=no

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

Successfully merging a pull request may close this issue.

5 participants