JWXiang-404 opened a new issue, #17550:
URL: https://github.com/apache/tvm/issues/17550

   Thanks for participating in the TVM community! We use https://discuss.tvm.ai 
for any general usage questions and discussions. The issue tracker is used for 
actionable items such as feature proposals discussion, roadmaps, and bug 
tracking.  You are always welcomed to post on the forum first :smile_cat:
   
   Issues that are inactive for a period of time may get closed. We adopt this 
policy so that we won't lose track of actionable issues that may fall at the 
bottom of the pile. Feel free to reopen a new one if you feel there is an 
additional problem that needs attention when an old one gets closed.
   
   ### Expected behavior
   
   Successfully import tvm in python.
   
   ### Actual behavior
   
   Segmentation fault (core dumped) when running `python -c "import tvm"` 
**after compiling TVM successfully** follow 
[this](https://tvm.apache.org/docs/install/from_source.html) doc.
   
   I've tried using **faulthandler** to locate the error:
   
   ```python
   #code.py
   import faulthandler
   faulthandler.enable()
   import tvm
   ```
   
   After running `python -X faulthandler code.py`, I got messages below:
   
   ```
   Fatal Python error: Segmentation fault
   
   Current thread 0x00007f01d5705280 (most recent call first):
     File "/root/tvm-18/python/tvm/_ffi/_ctypes/packed_func.py", line 235 in 
__call__
     File "/root/tvm-18/python/tvm/target/tag.py", line 33 in list_tags
     File "/root/tvm-18/python/tvm/target/tag.py", line 81 in <module>
     File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
     File "<frozen importlib._bootstrap_external>", line 843 in exec_module
     File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
     File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
     File "<frozen importlib._bootstrap>", line 991 in _find_and_load
     File "/root/tvm-18/python/tvm/target/__init__.py", line 77 in <module>
     File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
     File "<frozen importlib._bootstrap_external>", line 843 in exec_module
     File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
     File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
     File "<frozen importlib._bootstrap>", line 991 in _find_and_load
     File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
     File "<frozen importlib._bootstrap>", line 1042 in _handle_fromlist
     File "/root/tvm-18/python/tvm/__init__.py", line 58 in <module>
     File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
     File "<frozen importlib._bootstrap_external>", line 843 in exec_module
     File "<frozen importlib._bootstrap>", line 671 in _load_unlocked
     File "<frozen importlib._bootstrap>", line 975 in _find_and_load_unlocked
     File "<frozen importlib._bootstrap>", line 991 in _find_and_load
     File "code.py", line 3 in <module>
   Segmentation fault (core dumped)
   ```
   
   There seems to be something wrong with the fuction in 
`tvm/python/tvm/_ffi/_ctypes/packed_func.py` as mentioned above while executing 
in my Environment.
   
   ### Environment
   
    * Ubuntu 20.04.6 LTS
    * Docker image of 
[12.4.1-cudnn-devel-ubuntu20.04](https://hub.docker.com/layers/nvidia/cuda/12.4.1-cudnn-devel-ubuntu20.04/images/sha256-827ce25f7036c5a9c76a68d68c1f49295baef1c7e56157a8cd2495a6e40de2aa?context=explore)
    * LLVM-18.1.8 prebuild version for Ubuntu 18.04: (download from 
[here](https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz))
    * Use Apache TVM v0.18.0 Release version, and `config.cmake` appending 
settings are: `set(USE_CUDA   ON)`, `set(USE_CUBLAS ON)`, `set(USE_CUDNN ON)`, 
`set(USE_LLVM "\<path-to-llvm-config\> --ignore-libllvm --link-static")` and 
`set(HIDE_PRIVATE_SYMBOLS ON)`
    * Correctly set `TVM_HOME` and `PYTHONPATH`, use conda venv and python 3.8.
   
   ### Steps to reproduce
   
   ```
   python -c "import tvm"
   ```
   
   ### Triage
   
   * needs-triage
   * core:ffi
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to