You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "vfdff (via GitHub)" <gi...@apache.org> on 2024/12/18 14:29:36 UTC

[I] [Bug] No module named 'tvm' after specifing the TVM dynamic library [tvm]

vfdff opened a new issue, #17562:
URL: https://github.com/apache/tvm/issues/17562

   
   ### Expected behavior
   
   works fine without error message with the tvm building from source code
   
   ### Actual behavior
   
   report No module named 'tvm'
   ![image](https://github.com/user-attachments/assets/115ee998-12a8-46aa-a73c-c1bb5adef0c9)
   
   ### Environment
   
   Ubuntu 7.5.0-3ubuntu1~18.04 (cat /proc/version)
   Python 3.11.0
   
   ### Steps to reproduce
   
   1、According **https://tvm.hyper.ai/docs/install/from_source**, I build the tvm base on source code, and I can see libtvm.so libtvm_runtime.so under /home/zhongyunde/tvm/build
   ![image](https://github.com/user-attachments/assets/5d852f47-b620-4375-a975-6c85da473b01)
   
   2、I config **export TVM_LIBRARY_PATH=/home/zhongyunde/tvm/build** ,and test it with **python test.py**
   ```
   import tvm
   from tvm import relax
   from tvm.relax.frontend import nn
   
   
   class MLPModel(nn.Module):
       def __init__(self):
           super(MLPModel, self).__init__()
           self.fc1 = nn.Linear(784, 256)
           self.relu1 = nn.ReLU()
           self.fc2 = nn.Linear(256, 10)
   
       def forward(self, x):
           x = self.fc1(x)
           x = self.relu1(x)
           x = self.fc2(x)
           return x
   ```
   
   ### Triage
   
   Please refer to the list of label tags [here](https://github.com/apache/tvm/wiki/Issue-Triage-Labels) to find the relevant tags and add them below in a bullet format (example below).
   
   * needs-triage
   


-- 
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: commits-unsubscribe@tvm.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] No module named 'tvm' after specifing the TVM dynamic library [tvm]

Posted by "vfdff (via GitHub)" <gi...@apache.org>.
vfdff commented on issue #17562:
URL: https://github.com/apache/tvm/issues/17562#issuecomment-2556663623

   oh, now it works fine.
   
   * The correct config for my machine should be following:
   ```
   export TVM_HOME=/home/zhongyunde/tvm
   export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}
   ```
   
   * PS: /home/zhongyunde/envs/py311/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/zhongyunde/tvm/build/libtvm.so)
   ```
     rm /home/zhongyunde/envs/py311/bin/../lib/libstdc++.so.6 -rf
     ln -s /usr/lib32/libstdc++.so.6 /home/zhongyunde/envs/py311/bin/../lib/libstdc++.so.6
   ```


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] No module named 'tvm' after specifing the TVM dynamic library [tvm]

Posted by "vfdff (via GitHub)" <gi...@apache.org>.
vfdff commented on issue #17562:
URL: https://github.com/apache/tvm/issues/17562#issuecomment-2553114010

   Thanks for your input.
   
   * For example, now libtvm.so libtvm_runtime.so are under **/home/zhongyunde/tvm/build**,  and should I try the following commands ? (I test it, and it still fails.)
   ```
   export TVM_HOME=/home/zhongyunde/tvm/build
   export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}
   ```
   
   * I don't see there is an **python** under the /home/zhongyunde/tvm/build, so the PYTHONPATH doesn't take effect ? 
   Does I miss something, or  should they be move to a special path ?
   ```
   (mlir_venv) (base) root@998ee80b761b:/home/zhongyunde/tvm/build# ls
    CMakeCache.txt        DartConfiguration.tcl   Testing                 config.cmake                libbacktrace           libtvm_runtime.so        tvmConfig.cmake
    CMakeFiles            Makefile                cmake_install.cmake    'cpptest[1]_include.cmake'   libtvm.so              temp_config_file.cmake
    CTestTestfile.cmake   TVMBuildOptions.txt     compile_commands.json   demo.py                     libtvm_allvisible.so   test.py
   ```
   
   


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] No module named 'tvm' after specifing the TVM dynamic library [tvm]

Posted by "vfdff (via GitHub)" <gi...@apache.org>.
vfdff closed issue #17562: [Bug] No module named 'tvm' after specifing the TVM dynamic library
URL: https://github.com/apache/tvm/issues/17562


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] No module named 'tvm' after specifing the TVM dynamic library [tvm]

Posted by "talha-ahsan (via GitHub)" <gi...@apache.org>.
talha-ahsan commented on issue #17562:
URL: https://github.com/apache/tvm/issues/17562#issuecomment-2552746146

   I think the TVM docs you utilized are missing a step. 
   
   When I build from source, I normally export TVM_HOME and PYTHONPATH. If you're exporting TVM_LIBRARY_PATH then the docs show a second step which is to run `pip install -e /path-to-tvm/python` as well before running `python test.py` 


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org