tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[Bug] Hexagon Graph Launcher hexagon part build error

Open GofranChang opened this issue 2 years ago • 1 comments

When I try to compile the hexagon part of the hexagon graph launch, I get the following error:

In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.cc:20:
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.h:25:
/home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma_instructions.h:29:16: error: invalid instruction
  asm volatile("%0=dmpause" : "=r"(dm0));
               ^
<inline asm>:1:2: note: instantiated into assembly here
        r2=dmpause
        ^
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.cc:20:
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.h:25:
/home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma_instructions.h:33:48: error: invalid instruction
inline void dmstart(void* next) { asm volatile(" dmstart(%0)" : : "r"(next)); }
                                               ^
<inline asm>:1:3: note: instantiated into assembly here
         dmstart(r21)
         ^
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.cc:20:
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.h:25:
/home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma_instructions.h:36:16: error: invalid instruction
  asm volatile(" dmlink(%0, %1)" : : "r"(tail), "r"(next));
               ^
<inline asm>:1:3: note: instantiated into assembly here
         dmlink(r2, r21)
         ^
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.cc:20:
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.h:25:
/home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma_instructions.h:41:16: error: invalid instruction
  asm volatile(" %0 = dmpoll" : "=r"(dm0));
               ^
<inline asm>:1:3: note: instantiated into assembly here
         r2 = dmpoll
         ^
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.cc:20:
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.h:25:
/home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma_instructions.h:41:16: error: invalid instruction
  asm volatile(" %0 = dmpoll" : "=r"(dm0));
               ^
<inline asm>:1:3: note: instantiated into assembly here
         r2 = dmpoll
         ^
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.cc:20:
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.h:25:
/home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma_instructions.h:41:16: error: invalid instruction
  asm volatile(" %0 = dmpoll" : "=r"(dm0));
               ^
<inline asm>:1:3: note: instantiated into assembly here
         r2 = dmpoll
         ^
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.cc:20:
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.h:25:
/home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma_instructions.h:29:16: error: invalid instruction
  asm volatile("%0=dmpause" : "=r"(dm0));
               ^
<inline asm>:1:2: note: instantiated into assembly here
        r2=dmpause
        ^
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.cc:20:
In file included from /home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma.h:25:
/home/host/Documents/workspace/opensource/tvm/src/runtime/hexagon/hexagon_user_dma_instructions.h:29:16: error: invalid instruction
  asm volatile("%0=dmpause" : "=r"(dm0));
               ^
<inline asm>:1:2: note: instantiated into assembly here
        r2=dmpause
        ^
8 errors generated.
CMakeFiles/tvm_runtime_objs.dir/build.make:677: recipe for target 'CMakeFiles/tvm_runtime_objs.dir/src/runtime/hexagon/hexagon_user_dma.cc.o' failed
make[6]: *** [CMakeFiles/tvm_runtime_objs.dir/src/runtime/hexagon/hexagon_user_dma.cc.o] Error 1
CMakeFiles/Makefile2:117: recipe for target 'CMakeFiles/tvm_runtime_objs.dir/all' failed
make[5]: *** [CMakeFiles/tvm_runtime_objs.dir/all] Error 2
CMakeFiles/Makefile2:231: recipe for target 'CMakeFiles/runtime.dir/rule' failed
make[4]: *** [CMakeFiles/runtime.dir/rule] Error 2
Makefile:235: recipe for target 'runtime' failed
make[3]: *** [runtime] Error 2
CMakeFiles/static_hexagon_tvm_runtime.dir/build.make:85: recipe for target 'static_hexagon_tvm_runtime-prefix/src/static_hexagon_tvm_runtime-stamp/static_hexagon_tvm_runtime-build' failed
make[2]: *** [static_hexagon_tvm_runtime-prefix/src/static_hexagon_tvm_runtime-stamp/static_hexagon_tvm_runtime-build] Error 2
CMakeFiles/Makefile2:110: recipe for target 'CMakeFiles/static_hexagon_tvm_runtime.dir/all' failed
make[1]: *** [CMakeFiles/static_hexagon_tvm_runtime.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2

OS: Ubuntu 20.04 Hexagon SDK Version : 4.5.0.3 Hexagon Tool Version : 8.5.08

GofranChang avatar Mar 27 '23 07:03 GofranChang

Just change your argument -DUSE_HEXAGON_ARCH=v65 to v68 or after, cause hexagon don't support v65 func

mason20240920 avatar May 27 '24 08:05 mason20240920

I met the same problem for v66 while using Hexagon_SDK_4_5.

error such as : hexagon_user_dma_instructions.h:29:16: error: invalid instruction asm volatile(" %0 = dmpause" : "=r"(dm0));

chayliu-ecarx avatar Jul 16 '24 07:07 chayliu-ecarx