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

Error running HelloHexagon #1444

Closed
wiltswong opened this issue Aug 13, 2016 · 51 comments
Closed

Error running HelloHexagon #1444

wiltswong opened this issue Aug 13, 2016 · 51 comments

Comments

@wiltswong
Copy link

Following the instruction in Readme to install Hexagon SDK, installed LLVM 4.0, recompile the halide sources using LLVM 4.0 again too. Using the Hexagon SDK installer I got from Qualcomm, there is only "HEXAGON_Tools/7.2.12" directory, which is different from the description in Readme of "Hexagon_Tools/8.0" I tried hard searching around and not able to find Hexagon tools 8.0 anywhere.

Now if I adjust HL_HEXAGON_TOOLS accordingly to make things compile, I run into this error:

HL_TARGET=host ./pipeline pipeline_cpu-host pipeline_cpu
Target: x86-64-linux-avx-avx2-f16c-fma-sse41
HL_TARGET=host-hvx_64 ./pipeline pipeline_hvx64-host pipeline_hvx64
Target: x86-64-linux-avx-avx2-f16c-fma-hvx_64-sse41
warning: unknown warning option '-Wno-override-module' [-Wunknown-warning-option]
/tmp/hexrGI6K9.ll:2:1: error: expected top-level entity
source_filename = "/usr/local/google/home/wilwong/halide/Halide-20160812/src/runtime/noos.cpp"
^
1 warning and 1 error generated.
Internal error at /usr/local/google/home/wilwong/halide/Halide-20160812/src/HexagonOffload.cpp:342 triggered by user code at ./pipeline.cpp:91:
Condition failed: result == 0
hexagon-clang failed
make: *** [pipeline_hvx64-host.o] Aborted (core dumped)
rm pipeline_cpu-host.o

Search deeper, and apparently HexagonOffload.cpp is creating a temporary file and pass it to hexagon-clang, but the temporary file does not look like something I am familiar with (not C/C++).

Anybody knows what is going wrong? Does it has to do with the wrong version of Hexagon Tools?

Thanks!

@ronlieb
Copy link

ronlieb commented Aug 13, 2016

Yes this is due to not having Hexagon tools 8.0, please contact Qualcomm where you obtained the SDK 3.0 and ask to be notified when Hexagon SDK 3.1 is released (it will contain the 8.0 tools you need).

Could you contact me offline and tell me a bit about yourself and your company and your interest in Halide for HVX/Hexagon?

I work on the Halide for HVX/Hexagon project.

Thanks

Ron


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

From: wiltswong [mailto:notifications@github.com]
Sent: Friday, August 12, 2016 8:05 PM
To: halide/Halide Halide@noreply.github.com
Subject: [halide/Halide] Error running HelloHexagon (#1444)

Following the instruction in Readme to install Hexagon SDK, installed LLVM 4.0, recompile the halide sources using LLVM 4.0 again too. Using the Hexagon SDK installer I got from Qualcomm, there is only "HEXAGON_Tools/7.2.12" directory, which is different from the description in Readme of "Hexagon_Tools/8.0" I tried hard searching around and not able to find Hexagon tools 8.0 anywhere.

Now if I adjust HL_HEXAGON_TOOLS accordingly to make things compile, I run into this error:

HL_TARGET=host ./pipeline pipeline_cpu-host pipeline_cpu
Target: x86-64-linux-avx-avx2-f16c-fma-sse41
HL_TARGET=host-hvx_64 ./pipeline pipeline_hvx64-host pipeline_hvx64
Target: x86-64-linux-avx-avx2-f16c-fma-hvx_64-sse41
warning: unknown warning option '-Wno-override-module' [-Wunknown-warning-option]
/tmp/hexrGI6K9.ll:2:1: error: expected top-level entity
source_filename = "/usr/local/google/home/wilwong/halide/Halide-20160812/src/runtime/noos.cpp"
^
1 warning and 1 error generated.
Internal error at /usr/local/google/home/wilwong/halide/Halide-20160812/src/HexagonOffload.cpp:342 triggered by user code at ./pipeline.cpp:91:
Condition failed: result == 0
hexagon-clang failed
make: *** [pipeline_hvx64-host.o] Aborted (core dumped)
rm pipeline_cpu-host.o

Search deeper, and apparently HexagonOffload.cpp is creating a temporary file and pass it to hexagon-clang, but the temporary file does not look like something I am familiar with (not C/C++).

Anybody knows what is going wrong? Does it has to do with the wrong version of Hexagon Tools?

Thanks!


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #1444 , or mute the thread https://github.com/notifications/unsubscribe-auth/APZMZ2-Ph66M8gLA95C81tBKKdukuDwsks5qfRgkgaJpZM4JjkiI . https://github.com/notifications/beacon/APZMZ99s8r9UEisjHEKLLZiBHCC2S04Pks5qfRgkgaJpZM4JjkiI.gif

@ronlieb
Copy link

ronlieb commented Aug 13, 2016

Hi yes, ronl@codeaurora.org mailto:ronl@codeaurora.org is a good address to use for me.

Do you have a non github address you can use? Or do you prefer to go thru github ?


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

From: wiltswong [mailto:notifications@github.com]
Sent: Saturday, August 13, 2016 12:28 AM
To: halide/Halide Halide@noreply.github.com
Cc: ronlieb ronl@codeaurora.org; Comment comment@noreply.github.com
Subject: Re: [halide/Halide] Error running HelloHexagon (#1444)

Testing, checking to see if this email is reply-able! Do you read me?
wil.

ronlieb <notifications@github.com mailto:notifications@github.com > 於 2016年08月12日 (週五) 6:46 PM 寫道﹕

Yes this is due to not having Hexagon tools 8.0, please contact Qualcomm where you obtained the SDK 3.0 and ask to be notified when Hexagon SDK 3.1 is released (it will contain the 8.0 tools you need).

Could you contact me offline and tell me a bit about yourself and your company and your interest in Halide for HVX/Hexagon?

I work on the Halide for HVX/Hexagon project.

Thanks

Ron


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

From: wiltswong [mailto:notifications@github.com]
Sent: Friday, August 12, 2016 8:05 PM
To: halide/Halide <Halide@noreply.github.com mailto:Halide@noreply.github.com >
Subject: [halide/Halide] Error running HelloHexagon (#1444)

Following the instruction in Readme to install Hexagon SDK, installed LLVM 4.0, recompile the halide sources using LLVM 4.0 again too. Using the Hexagon SDK installer I got from Qualcomm, there is only "HEXAGON_Tools/7.2.12" directory, which is different from the description in Readme of "Hexagon_Tools/8.0" I tried hard searching around and not able to find Hexagon tools 8.0 anywhere.

Now if I adjust HL_HEXAGON_TOOLS accordingly to make things compile, I run into this error:

HL_TARGET=host ./pipeline pipeline_cpu-host pipeline_cpu
Target: x86-64-linux-avx-avx2-f16c-fma-sse41
HL_TARGET=host-hvx_64 ./pipeline pipeline_hvx64-host pipeline_hvx64
Target: x86-64-linux-avx-avx2-f16c-fma-hvx_64-sse41
warning: unknown warning option '-Wno-override-module' [-Wunknown-warning-option]
/tmp/hexrGI6K9.ll:2:1: error: expected top-level entity
source_filename = "/usr/local/google/home/wilwong/halide/Halide-20160812/src/runtime/noos.cpp"
^
1 warning and 1 error generated.
Internal error at /usr/local/google/home/wilwong/halide/Halide-20160812/src/HexagonOffload.cpp:342 triggered by user code at ./pipeline.cpp:91:
Condition failed: result == 0
hexagon-clang failed
make: *** [pipeline_hvx64-host.o] Aborted (core dumped)
rm pipeline_cpu-host.o

Search deeper, and apparently HexagonOffload.cpp is creating a temporary file and pass it to hexagon-clang, but the temporary file does not look like something I am familiar with (not C/C++).

Anybody knows what is going wrong? Does it has to do with the wrong version of Hexagon Tools?

Thanks!


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #1444 , or mute the thread https://github.com/notifications/unsubscribe-auth/APZMZ2-Ph66M8gLA95C81tBKKdukuDwsks5qfRgkgaJpZM4JjkiI . https://github.com/notifications/beacon/APZMZ99s8r9UEisjHEKLLZiBHCC2S04Pks5qfRgkgaJpZM4JjkiI.gif


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #1444 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/APZMZyCeXllGLYRofqOmaH4O8xgko5L_ks5qfVXIgaJpZM4JjkiI . https://github.com/notifications/beacon/APZMZyoZDyd2T4K3FXilEjA25tXc4f1Jks5qfVXIgaJpZM4JjkiI.gif

@victorv
Copy link

victorv commented Sep 21, 2016

Make multiple requests to for Hexagon 8.0 tools and no response... Any idea when / how to get these?

@dsharletg
Copy link
Contributor

I believe the 8.0 tools are now publicly available (after registration) from Qualcomm on CreatePoint: https://createpoint.qti.qualcomm.com/dashboard/public/landing

@ronlieb should be able to confirm or give further guidance.

@victorv
Copy link

victorv commented Sep 21, 2016

OK. I am only registered at developer.qualcomm.com, which does not have the latest tools, rather than the CreatePointe which is a different site. Thanks for the update.

@yefeiw
Copy link

yefeiw commented Oct 5, 2016

Hi,

I am have the message running HelloHexagon:
I have Hexagon SDK 3.0 and Hexagon Tools 8.0. However, for some reason I am still seeing the below errors and I am not sure how will I be able to debug them?

yefeiw@yefeiw-linux:/local/mnt/workspace/Halide/apps/HelloHexagon$ source envsetup.sh
yefeiw@yefeiw-linux:/local/mnt/workspace/Halide/apps/HelloHexagon$ make run-host
HL_TARGET=host ./pipeline pipeline_cpu-host pipeline_cpu
Target: x86-64-linux-avx-avx2-f16c-fma-sse41
HL_TARGET=host-hvx_64 ./pipeline pipeline_hvx64-host pipeline_hvx64
Target: x86-64-linux-avx-avx2-f16c-fma-hvx_64-sse41
Error at ./pipeline.cpp:98:
hexagon not enabled for this build of Halide.
make: *** [pipeline_hvx64-host.o] Aborted (core dumped)
rm pipeline_cpu-host.o

@zvookin
Copy link
Member

zvookin commented Oct 5, 2016

How are you building Halide? Does running the command "llvm-config
--components" with the build of llvm you are using show "hexagon" in the
output?

-Z-

On Tue, Oct 4, 2016 at 5:57 PM, yefeiw notifications@github.com wrote:

Hi,

I am have the message running HelloHexagon:
I have Hexagon SDK 3.0 and Hexagon Tools 8.0. However, for some reason I
am still seeing the below errors and I am not sure how will I be able to
debug them?

yefeiw@yefeiw-linux:/local/mnt/workspace/Halide/apps/HelloHexagon$ source
envsetup.sh
yefeiw@yefeiw-linux:/local/mnt/workspace/Halide/apps/HelloHexagon$ make
run-host
HL_TARGET=host ./pipeline pipeline_cpu-host pipeline_cpu
Target: x86-64-linux-avx-avx2-f16c-fma-sse41
HL_TARGET=host-hvx_64 ./pipeline pipeline_hvx64-host pipeline_hvx64
Target: x86-64-linux-avx-avx2-f16c-fma-hvx_64-sse41
Error at ./pipeline.cpp:98:
hexagon not enabled for this build of Halide.
make: *** [pipeline_hvx64-host.o] Aborted (core dumped)
rm pipeline_cpu-host.o


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1444 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABbqFNmlBXsnG-tqAgUu7TLiSFcvTyGYks5qwvYTgaJpZM4JjkiI
.

@yefeiw
Copy link

yefeiw commented Oct 5, 2016

Thanks for the input! You are right there is no hexagon showing up in the components list.
I think then I am a little confused, since I followed the instructions in the cmake settings:
cmake -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_TARGETS_TO_BUILD="X86;ARM;NVPTX;AArch64;Mips;PowerPC;Hexagon" -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release ..
If so, I think I would expect hexagon to show up? I am not sure if I am missing something basic...?

@dsharletg
Copy link
Contributor

Which version of LLVM are you using? I think you need at least LLVM version 3.9.

@zvookin
Copy link
Member

zvookin commented Oct 5, 2016

I use "-DLLVM_TARGETS_TO_BUILD=all" to cmake for llvm. With top of tree I
am getting Hexagon.

Also, make sure you are getting llvm from your build, not some system
location. (E.g. check the output of "which llvm-config". Apologies if this
is obvious, but I've made this mistake before myself.)

-Z-

On Tue, Oct 4, 2016 at 6:07 PM, Dillon Sharlet notifications@github.com
wrote:

Which version of LLVM are you using? I think you need at least LLVM
version 3.9.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1444 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABbqFF_4Wn2HEd0SvxySXCjsDp2wMz7nks5qwvhBgaJpZM4JjkiI
.

@yefeiw
Copy link

yefeiw commented Oct 5, 2016

I did use LLVM 3.9 by svn co
yefeiw@yefeiw-linux:/local/mnt/workspace/Halide/apps/HelloHexagon$ clang --version
clang version 3.9.1 (branches/release_39 283275) (llvm/branches/release_39 283273)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/mnt/workspace/llvm/build/bin

Let me try it all over again, in case I used the "stock" cmake settings accidentally

@yefeiw
Copy link

yefeiw commented Oct 5, 2016

Hi Gurus,

Thanks again for the help so far... I think I have built llvm and Halide again, and then I still see the same error.

Now I did see hexagon in my llvm-config, btw:
yefeiw@yefeiw-linux:/local/mnt/workspace/Halide/apps/HelloHexagon$ llvm-config --components |grep hexagon
aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils all all-targets analysis arm armasmparser armasmprinter armcodegen armdesc armdisassembler arminfo asmparser asmprinter bitreader bitwriter codegen core coverage debuginfocodeview debuginfodwarf debuginfopdb engine executionengine globalisel gtest gtest_main hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader libdriver lineeditor linker lto mc mcdisassembler mcjit mcparser mips mipsasmparser mipsasmprinter mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser native nativecodegen nvptx nvptxasmprinter nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes powerpc powerpcasmparser powerpcasmprinter powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata runtimedyld scalaropts selectiondag support symbolize tablegen target transformutils vectorize x86 x86asmparser x86asmprinter x86codegen x86desc x86disassembler x86info x86utils

could it be that I have to put my hexagon tools inside the hexagon sdk? Actually I think I did not find any clue to narrow down the issue, and thus I am wondering what I could do to make it compile...

@zvookin
Copy link
Member

zvookin commented Oct 5, 2016

Are you building Halide with make or cmake? If building Halide with CMake,
you likely need to set -DTARGET_HEXAGON=1 on the cmake command line. (And
given that it is cmake, you might have to rm the caches and everything
else.) If building with make, a "make clean; make" should include hexagon
if llvm-config is reporting the components as above.

-Z-

On Tue, Oct 4, 2016 at 11:37 PM, yefeiw notifications@github.com wrote:

Hi Gurus,

Thanks again for the help so far... I think I have built llvm and Halide
again, and then I still see the same error.

Now I did see hexagon in my llvm-config, btw:
yefeiw@yefeiw-linux:/local/mnt/workspace/Halide/apps/HelloHexagon$
llvm-config --components |grep hexagon
aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc
aarch64disassembler aarch64info aarch64utils all all-targets analysis arm
armasmparser armasmprinter armcodegen armdesc armdisassembler arminfo
asmparser asmprinter bitreader bitwriter codegen core coverage
debuginfocodeview debuginfodwarf debuginfopdb engine executionengine
globalisel gtest gtest_main hexagon hexagonasmparser hexagoncodegen
hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation
interpreter ipo irreader libdriver lineeditor linker lto mc mcdisassembler
mcjit mcparser mips mipsasmparser mipsasmprinter mipscodegen mipsdesc
mipsdisassembler mipsinfo mirparser native nativecodegen nvptx
nvptxasmprinter nvptxcodegen nvptxdesc nvptxinfo objcarcopts object
objectyaml option orcjit passes powerpc powerpcasmparser powerpcasmprinter
powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata
runtimedyld scalaropts selectiondag support symbolize tablegen target
transformutils vectorize x86 x86asmparser x86asmprinter x86codegen x86desc
x86disassembler x86info x86utils

could it be that I have to put my hexagon tools inside the hexagon sdk?
Actually I think I did not find any clue to narrow down the issue, and thus
I am wondering what I could do to make it compile...


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1444 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABbqFEk3E4MmR6J4SmttDqWjLQ2Z85EZks5qw0WWgaJpZM4JjkiI
.

@pranavb-ca
Copy link
Contributor

What have you set your HL_HEXAGON_TOOLS variable to?

Pranav
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

On Oct 5, 2016, at 2:44 AM, Zalman Stern notifications@github.com wrote:

Are you building Halide with make or cmake? If building Halide with CMake,
you likely need to set -DTARGET_HEXAGON=1 on the cmake command line. (And
given that it is cmake, you might have to rm the caches and everything
else.) If building with make, a "make clean; make" should include hexagon
if llvm-config is reporting the components as above.

-Z-

On Tue, Oct 4, 2016 at 11:37 PM, yefeiw notifications@github.com wrote:

Hi Gurus,

Thanks again for the help so far... I think I have built llvm and Halide
again, and then I still see the same error.

Now I did see hexagon in my llvm-config, btw:
yefeiw@yefeiw-linux:/local/mnt/workspace/Halide/apps/HelloHexagon$
llvm-config --components |grep hexagon
aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc
aarch64disassembler aarch64info aarch64utils all all-targets analysis arm
armasmparser armasmprinter armcodegen armdesc armdisassembler arminfo
asmparser asmprinter bitreader bitwriter codegen core coverage
debuginfocodeview debuginfodwarf debuginfopdb engine executionengine
globalisel gtest gtest_main hexagon hexagonasmparser hexagoncodegen
hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation
interpreter ipo irreader libdriver lineeditor linker lto mc mcdisassembler
mcjit mcparser mips mipsasmparser mipsasmprinter mipscodegen mipsdesc
mipsdisassembler mipsinfo mirparser native nativecodegen nvptx
nvptxasmprinter nvptxcodegen nvptxdesc nvptxinfo objcarcopts object
objectyaml option orcjit passes powerpc powerpcasmparser powerpcasmprinter
powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata
runtimedyld scalaropts selectiondag support symbolize tablegen target
transformutils vectorize x86 x86asmparser x86asmprinter x86codegen x86desc
x86disassembler x86info x86utils

could it be that I have to put my hexagon tools inside the hexagon sdk?
Actually I think I did not find any clue to narrow down the issue, and thus
I am wondering what I could do to make it compile...


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1444 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABbqFEk3E4MmR6J4SmttDqWjLQ2Z85EZks5qw0WWgaJpZM4JjkiI
.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #1444 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AP1HGnN_0By28DsLbGqpnpOAVeR6-edIks5qw1VjgaJpZM4JjkiI.

@yefeiw
Copy link

yefeiw commented Oct 5, 2016

Thanks for the inputs!

I am using make to build Halide. I remembered that I have clean-built once and the problem persists, let me try putting some messages in the makefile to see if I can figure something more...

@yefeiw
Copy link

yefeiw commented Oct 5, 2016

Hi all,

Thanks for all the help! After rebuilding everything (cmake, llvm, Halide, app), and using the latest Hexagon tools release, I am able to run the examples.

@donwinters
Copy link

Hi all,

I was having similar issues in building which I did get past with the latest llvm and hexagon tools (4.0 and 8.0.07).

But when I run in the simulator I get an error. I'm very new to hexagon so maybe I'm missing something basic here. Any notion as to why initialization of hexagon kernels failed?

./process-host cpu 10
Using CPU schedule
Running pipeline...
Done, time: 0.0011177 s
Success!
./process-host hvx64 1
Using HVX 64 schedule
Running pipeline...
ConfigureExecutableBinary:: stat() failed: errno = 2 for dir/file (hexagon_sim_remote)
ConfigureExecutableBinary: No such file or directory
HexagonWrapper::ConfigureExecutableBinary failed: 4
Error: Initialization of Hexagon kernels failed
Makefile:50: recipe for target 'run-host' failed
make: *** [run-host] Aborted (core dumped)

@ronlieb
Copy link

ronlieb commented Dec 13, 2016 via email

@donwinters
Copy link

Ron,

Thanks, that did it. Is that documented anywhere? I didn't see it.

dwinters@dwinters-ThinkPad-T430s:~/Dev/halide_pub/apps/HelloHexagon$ LD_LIBRARY_PATH=../../src/runtime/hexagon_remote/bin/host/:$HL_HEXAGON_TOOLS/lib/iss/:. make run-host
./process-host cpu 10
Using CPU schedule
Running pipeline...
Done, time: 0.0011132 s
Success!
./process-host hvx64 1
Using HVX 64 schedule
Running pipeline...
Done, time: 1.49568 s
Success!
./process-host hvx128 1
Using HVX 128 schedule
Running pipeline...
Done, time: 1.29598 s
Success!

@ronlieb
Copy link

ronlieb commented Dec 13, 2016 via email

@ronlieb
Copy link

ronlieb commented Dec 13, 2016 via email

@ronlieb
Copy link

ronlieb commented Dec 13, 2016 via email

@donwinters
Copy link

Ron,

But the cpu version uses the host directory, so it fails is I use v60

LD_LIBRARY_PATH=../../src/runtime/hexagon_remote/bin/v60/:$HL_HEXAGON_TOOLS/lib/iss/:. make run-host
./process-host cpu 10
Using CPU schedule
Error: libhalide_hexagon_host.so not found.
Makefile:50: recipe for target 'run-host' failed
make: *** [run-host] Aborted (core dumped)

@ronlieb
Copy link

ronlieb commented Dec 13, 2016 via email

@victorv
Copy link

victorv commented Dec 13, 2016

Would it be possible to revert back to the SDK 3.0 tools (7.2.12) by removing certain Hexagon features? We want to evaluate the halide hexagon performance but we cannot get the latest 8.0 tool chain.

@dsharletg
Copy link
Contributor

Currently, Halide only actually uses the Hexagon SDK for the simulator, and to build the runtime (which comes as a prebuilt in src/runtime/hexagon_remote). Codegen happens with LLVM, independent of the Hexagon SDK.

If you need to use the simulator from SDK 7.2.12, you might need to rebuild the remote runtime (src/runtime/hexagon_remote) using the compiler in that SDK package. This should be doable, but you'll probably need to change some things in the Makefile (I vaguely remember that Qualcomm changed some paths from Src to src and similar changes).

I am trying to think if there were any breaking changes that you'll run into, but I don't believe so.

@ronlieb
Copy link

ronlieb commented Dec 13, 2016 via email

@ronlieb
Copy link

ronlieb commented Dec 13, 2016 via email

@victorv
Copy link

victorv commented Dec 14, 2016

@dsharletg - thanks. We don't need the hexagon simulator under halide. So I will look into what you suggest. I would think the back-end link-edit for the hexagon must happen with hexagon tools and maybe the existing tools will work.

@ronlieb - thanks. I have sent you an email separately. If you can recall why the halide runtime cannot work with the 7.2.x tools, maybe I can make a workaround.

@ckun5
Copy link

ckun5 commented Sep 12, 2017

Hi all,
Thanks a lot. I did as above, I can run using CPU schedule, but HVX can't . Log shows below:
Using CPU schedule
Running pipeline...
Done, time: 0.0026418 s
Success!
Using HVX 64 schedule
Running pipeline...
Using HVX 128 schedule
Running pipeline...
So, how can I do? Thank you.

@ronlieb
Copy link

ronlieb commented Sep 12, 2017 via email

@ckun5
Copy link

ckun5 commented Sep 16, 2017

I have pushed the 3 libraries like:

adb root
adb remount
adb shell mkdir -p /system/lib/rfsa/adsp
adb push $HALIDE_ROOT/lib/arm-32-android/libhalide_hexagon_host.so /system/lib/
adb push $HALIDE_ROOT/lib/arm-64-android/libhalide_hexagon_host.so /system/lib64/
adb push $HALIDE_ROOT/lib/v60/libhalide_hexagon_remote_skel.so /system/lib/rfsa/adsp/
adb reboot

There is a test signature and I can run HVX example downscaleBay2 successfully, so it means signature is right. Is there a signature for Halide?

@ronlieb
Copy link

ronlieb commented Sep 16, 2017 via email

@ckun5
Copy link

ckun5 commented Sep 27, 2017

Hi Ron,
Thank you very much!
I got the Hexagon SDK 3.3.0. I tested it on the phone with SDM660 and it still be wrong.
There is no problem when I ran ./test-Hello-app-android .The logs shows below:

......

  • result=0
  • cat

To run this example on an Android device, do:
adb push bin/process-hello-android /data/
adb shell chmod +x /data/process-hello-android
adb shell /data/process-hello-android cpu 10
adb shell /data/process-hello-android hvx64 10
adb shell /data/process-hello-android hvx128 10

  • exit 0

But when I ran it on my phone, it didn't work, the logs shows below:

    Using CPU schedule
    Using HVX 64 schedule
    Using HVX 128 schedule

I can use CPU schedule with the Hexagon SDK 3.2, but now can't. I also tested it on the phone with the Snapdragon 835 and got the same result.
Please help me to see if there is something not right.
@abadams
Thanks.

@ronlieb
Copy link

ronlieb commented Sep 27, 2017 via email

@amirjamez
Copy link

amirjamez commented Oct 23, 2017

@ronlieb I read the thread and have the same core-dump issue on 2 out of 7 Examples:

Done testing: 7 tests (5 pass, 2 fail, 0 skipped)
Failing tests:
    HelloHexagon/test-Hello-app
    HelloHexagon/test-Hello-app-android

Tested with SDK 7.22 ad 8.0.10. Could you let me know which version is compatible with what Halide? Also, the README.md file in the git seems to point to nonexistent folders when it describes the env-set for Hallide at the end. A little clarification might be helpful. Thanks.

@ronlieb
Copy link

ronlieb commented Oct 23, 2017 via email

@amirjamez
Copy link

Thanks, @ronlieb for the clarification. I was wondering whether HelloHexagon and test-camera-pipe are the only apps which can be executed on the actual board. It seems that the other 5 are executable with simulator only. Am I correct?

@ronlieb
Copy link

ronlieb commented Oct 25, 2017 via email

@amirjamez
Copy link

Thanks, @ronlieb. The reason I asked was the fact that I could not find the Halide 2.0 (from the create point). I can see these apps at the Halide Git. I am not sure with my current setup (SDK v3.2) I can use the apps in the Git. Could you let me know the correct download link?

@ronlieb
Copy link

ronlieb commented Oct 25, 2017 via email

@amirjamez
Copy link

amirjamez commented Oct 25, 2017

@ronlieb, It redirects to this webpage https://createpoint.qti.qualcomm.com/tools/public/error/notfound which says item not found.

@ronlieb
Copy link

ronlieb commented Oct 25, 2017 via email

@amirjamez
Copy link

amirjamez commented Oct 26, 2017

Thanks, @ronlieb. For now I executed the HelloHexagon and collected te adb logcat to see how it works. I got two questions.
(1) Why does only the first printf in the process.cpp gets executed on the board, the rest it seems to be only executed on the simulator as I don't see the outputs on the board.

So these outputs are seen on the board:

 int (*pipeline)(buffer_t *, buffer_t*);
    if (strcmp(argv[1], "cpu") == 0) {
        pipeline = pipeline_cpu;
        printf("Using CPU schedule\n");
    } else if (strcmp(argv[1], "hvx64") == 0) {
        pipeline = pipeline_hvx64;
        printf("Using HVX 64 schedule\n");
    } else if (strcmp(argv[1], "hvx128") == 0) {
        pipeline = pipeline_hvx128;
        printf("Using HVX 128 schedule with %d iterations\n",atoi(argv[2]));
    } else {
        printf("Unknown schedule, valid schedules are cpu, hvx64, or hvx128\n");
        return -1; 
    }   
    int iterations = atoi(argv[2]);

The rest were not executed, i.e.:


 halide_hexagon_power_hvx_on(NULL);

    printf("Running pipeline with (width, height)=(%d,%d)\n",W,H);
    double time = benchmark(iterations, 10, [&]() {
        int result = pipeline(in, out);
        if (result != 0) {
            printf("pipeline failed! %d\n", result);
        }
    });

(2) Also looking at my logcat, apparently something is crashing. Can you trace it?

04-09 21:09:55.892 29780 29780 F DEBUG   :     sp   0000007fec999a90  pc   0000005555564f88  pstate 0000000080
000000
04-09 21:09:55.897 29780 29780 F DEBUG   :
04-09 21:09:55.897 29780 29780 F DEBUG   : backtrace:
04-09 21:09:55.898 29780 29780 F DEBUG   :     #00 pc 000000000000ff88  /data/process-hello-android (main+3384
)
04-09 21:09:55.898 29780 29780 F DEBUG   :     #01 pc 000000000001a758  /system/lib64/libc.so (__libc_init+88)
04-09 21:09:55.898 29780 29780 F DEBUG   :     #02 pc 0000000000010334  /data/process-hello-android (do_arm64_
start+60)
--------- beginning of system
04-09 21:09:55.922  1158  1343 W NativeCrashListener: Couldn't find ProcessRecord for pid 29778
04-09 21:09:55.924   421   421 W         : debuggerd: resuming target 29778
04-09 21:09:55.925   421   421 E         : debuggerd: failed to send signal 18 to target: No such process
04-09 21:09:55.925  1158  1207 I BootReceiver: Copying /data/tombstones/tombstone_09 to DropBox (SYSTEM_TOMBST
ONE)
04-09 21:12:15.528  1880  2406 I DPMJ    : |SERVICE| DPM_D_REQ_GET_RUNNING_APP_LIST
04-09 21:12:27.573 29798 29798 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 29798 (pro
cess-hello-a)
04-09 21:12:27.573   421   421 W         : debuggerd: handling request: pid=29798 uid=0 gid=0 tid=29798
04-09 21:12:27.629 29800 29800 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-09 21:12:27.629 29800 29800 F DEBUG   : Build fingerprint: 'Android/msm8996/msm8996:7.0/OpenQ-820_N_v3.2/git03151147:userdebug/test-keys'
04-09 21:12:27.629 29800 29800 F DEBUG   : Revision: '0'
04-09 21:12:27.629 29800 29800 F DEBUG   : ABI: 'arm64'
04-09 21:12:27.629 29800 29800 F DEBUG   : pid: 29798, tid: 29798, name: process-hello-a  >>> /data/process-hello-android <<<
04-09 21:12:27.629 29800 29800 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
04-09 21:12:27.630 29800 29800 F DEBUG   :     x0   000000006b8b4567  x1   0000000000000001  x2   0000000000000000  x3   0000000000400000
04-09 21:12:27.630 29800 29800 F DEBUG   :     x4   0000000000000001  x5   0000000000000001  x6   0000000000000000  x7   0000000000400000
04-09 21:12:27.630 29800 29800 F DEBUG   :     x8   0000000000000000  x9   0000000000000002  x10  0000000000000001  x11  0000000000000000
04-09 21:12:27.630 29800 29800 F DEBUG   :     x12  0000007f86dd75e0  x13  0000007f86dd7658  x14  0000007f86dd75dc  x15  0000007f86e23000
04-09 21:12:27.630 29800 29800 F DEBUG   :     x16  0000007f86dd6458  x17  0000007f86d7e24c  x18  00000000ffffffff  x19  0000000000000000
04-09 21:12:27.630 29800 29800 F DEBUG   :     x20  0000000000000001  x21  0000000000c00000  x22  0000000000000000  x23  0000000000000001
04-09 21:12:27.630 29800 29800 F DEBUG   :     x24  0000007fd722b350  x25  0000000000c00000  x26  0000000000c00000  x27  0000000000000000
04-09 21:12:27.630 29800 29800 F DEBUG   :     x28  000000555557d64c  x29  0000007fd722b260  x30  0000005555564f88
04-09 21:12:27.630 29800 29800 F DEBUG   :     sp   0000007fd722b260  pc   0000005555564f88  pstate 0000000080000000
04-09 21:12:27.635 29800 29800 F DEBUG   :
04-09 21:12:27.635 29800 29800 F DEBUG   : backtrace:
04-09 21:12:27.635 29800 29800 F DEBUG   :     #00 pc 000000000000ff88  /data/process-hello-android (main+3384)
04-09 21:12:27.635 29800 29800 F DEBUG   :     #01 pc 000000000001a758  /system/lib64/libc.so (__libc_init+88)
04-09 21:12:27.635 29800 29800 F DEBUG   :     #02 pc 0000000000010334  /data/process-hello-android (do_arm64_start+60)
04-09 21:12:27.661  1158  1343 W NativeCrashListener: Couldn't find ProcessRecord for pid 29798
04-09 21:12:27.664   421   421 W         : debuggerd: resuming target 29798
04-09 21:12:27.664   421   421 E         : debuggerd: failed to send signal 18 to target: No such process
04-09 21:12:27.664  1158  1207 I BootReceiver: Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)

P.s: I had already signed my board using this method before.

@ronlieb
Copy link

ronlieb commented Oct 26, 2017 via email

@amirjamez
Copy link

@ronlieb I am not sure how to open that to monitor the 820 board:

$Hexagon_SDK/3.2/tools/debug/mini-dm/Linux_Debug/mini-dm
Running mini-dm version: 3.1
Device open failed with error -3

$Hexagon_SDK/3.2/tools/debug/mini-dm/Linux_Debug/mini-dm devices
Connected devices:
Device: 0x220ccf0       Port#: 4

$Hexagon_SDK/3.2/tools/debug/mini-dm/Linux_Debug/mini-dm devices 4
Running mini-dm version: 3.1
The following are the connected devices
Device open failed with error -3

Also I checked the assembly generated by ARM-backend and it seems that it does not have any HVX vector instruction inside:

        mov     x0, 0
        bl      halide_hexagon_power_hvx_on
        mov     w1, 4096
        adrp    x0, .LC13
        add     x0, x0, :lo12:.LC13
        mov     w2, w1
        bl      printf
        ldr     w0, [x29,176]
        cmp     w0, wzr
        ble     .L156
        ldr     d8, .LC3
        adrp    x25, .LC14
        ldr     d9, .LC15
        mov     w23, 0
        add     x25, x25, :lo12:.LC14
.L113:
        bl      _ZNSt6chrono3_V212system_clock3nowEv
        mov     w21, 10
        mov     x22, x0
        b       .L108
.L212:
        subs    w21, w21, #1
        beq     .L211
.L108:
        fmov    x0, d11
        fmov    x1, d10
        blr     x28
        mov     w1, w0
        cbz     w0, .L212
        mov     x0, x25
        bl      printf
        subs    w21, w21, #1
        bne     .L108
.L211:
        bl      _ZNSt6chrono3_V212system_clock3nowEv
        sub     x0, x0, x22
        mov     x1, 63439
        movk    x1, 0xe353, lsl 16
        movk    x1, 0x9ba5, lsl 32
        smulh   x1, x0, x1
        asr     x2, x1, 7
        sub     x0, x2, x0, asr 63
        scvtf   d1, x0
        fdiv    d1, d1, d9
        fcmpe   d1, d8
        bpl     .L111
        fmov    d8, d1
.L111:
        ldr     w0, [x29,176]
        add     w23, w23, 1
        cmp     w23, w0
        bne     .L113
        fmov    d0, 1.0e+1
        fdiv    d0, d8, d0
        b       .L106
.L156:
        ldr     d0, .LC3
.L106:
        adrp    x0, .LC16
        add     x0, x0, :lo12:.LC16
        bl      printf
        mov     x0, 0
        bl      halide_hexagon_power_hvx_off
        ldr     w3, [x29,360]
        mov     w0, 1
        mov     w1, 4
        mov     w2, 6
        strh    w0, [x29,224]

@ronlieb
Copy link

ronlieb commented Oct 26, 2017 via email

@amirjamez
Copy link

amirjamez commented Oct 26, 2017

Sorry if I don't know how to collect msg using mini-dm. mini-dm help shows only two options and none is outputting any monitoring logs. Basically, nothing displays on the output when I execute the binary or send commands to the board:

$Hexagon_SDK/3.2/tools/debug/mini-dm/Linux_Debug/mini-dm 4
Running mini-dm version: 3.1
The following are the connected devices
mini-dm is waiting for a DMSS connection...
DMSS is connected. Running mini-dm...

@ronlieb, so objdump should be able to see it? (i.e., bl 5260 <dlopen@ plt> ?)

-Output for HellowHexagon process-hello-android:

2118     6e84:       d61f00a0        br      x5
 2119 
 2120 0000000000006e88 <_ZN6Halide7Runtime8Internal22halide_get_symbol_implEPKc>:
 2121     6e88:       aa0003e8        mov     x8, x0
 2122     6e8c:       aa1f03e0        mov     x0, xzr
 2123     6e90:       aa0803e1        mov     x1, x8
 2124     6e94:       17fff90b        b       52c0 <dlsym@plt>
 2125 
 2126 0000000000006e98 <_ZN6Halide7Runtime8Internal24halide_load_library_implEPKc>:
 2127     6e98:       f81e0ff3        str     x19, [sp,#-32]!
 2128     6e9c:       320003e1        orr     w1, wzr, #0x1
 2129     6ea0:       a9017bfd        stp     x29, x30, [sp,#16]
 2130     6ea4:       910043fd        add     x29, sp, #0x10
 2131     6ea8:       97fff8ee        bl      5260 <dlopen@plt>
 2132     6eac:       aa0003f3        mov     x19, x0
 2133     6eb0:       b5000053        cbnz    x19, 6eb8 <_ZN6Halide7Runtime8Internal24halide_load_library_impl      EPKc+0x20>
 2134     6eb4:       97fff88f        bl      50f0 <dlerror@plt>
 2135     6eb8:       a9417bfd        ldp     x29, x30, [sp,#16]
 2136     6ebc:       aa1303e0        mov     x0, x19
 2137     6ec0:       f84207f3        ldr     x19, [sp],#32
 2138     6ec4:       d65f03c0        ret
 2139 
 2140 0000000000006ec8 <_ZN6Halide7Runtime8Internal30halide_get_library_symbol_implEPvPKc>:
 2141     6ec8:       17fff8fe        b       52c0 <dlsym@plt>
 2142 
 2143 0000000000006ecc <halide_set_custom_get_symbol>:
 2144     6ecc:       900002a9        adrp    x9, 5a000 <cplus_demangle_operators+0x78>
 2145     6ed0:       f9476129        ldr     x9, [x9,#3776]

@ronlieb
Copy link

ronlieb commented Oct 26, 2017 via email

@amirjamez
Copy link

Thanks Ron, but last time I exactly did that. Nothing is shown via mini-dm

@ronlieb
Copy link

ronlieb commented Oct 26, 2017 via email

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

No branches or pull requests

10 participants