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

[Misc] enhance ti.init for ti.gpu #843

Merged
merged 5 commits into from
Apr 22, 2020
Merged

Conversation

archibate
Copy link
Collaborator

@archibate archibate requested a review from yuanming-hu April 22, 2020 02:46
Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM in general!

python/taichi/lang/__init__.py Outdated Show resolved Hide resolved
@archibate archibate requested a review from yuanming-hu April 22, 2020 03:20
@archibate
Copy link
Collaborator Author

echo %APPVEYOR_REPO_COMMIT_MESSAGE% | grep '^\[format\]' && curl http://kun.csail.mit.edu:31415/%APPVEYOR_PULL_REQUEST_NUMBER% -LO || true
fix 
'nit' is not recognized as an internal or external command,
operable program or batch file.

Silly win cmd... it expands %APPVEYOR_REPO_COMMIT_MESSAGE% too...

Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything good now. I'll merge once CI passes.

@yuanming-hu yuanming-hu merged commit 5db9f22 into taichi-dev:master Apr 22, 2020
@yuanming-hu
Copy link
Member

Btw, https://ci.appveyor.com/project/yuanming-hu/taichi/builds/32350390/job/28ub97s4tgh79h19#L9378 is slightly alarming. This means if someone's computer does not actually support WGL then using ti.gpu will lead to a crash instead of falling back to CPU. Let's fix this (detect if WGL support exists and only return true in with_opengl in that case) before releasing v0.5.15.

archibate added a commit to archibate/taichi that referenced this pull request Apr 22, 2020
yuanming-hu pushed a commit that referenced this pull request Apr 23, 2020
This was referenced Apr 24, 2020
@yuanming-hu
Copy link
Member

Thanks for improving portability. However, with #864, I'm still getting this on Linux, even if I exclude opengl while testing:

ti test -t 1 -na opengl
[E 04/26/20 11:09:30.464] [opengl_api.cpp:initialize_opengl@281] [glsl] cannot create GLFW window: error 65537: The GLFW library is not initialized


�[38;2;255;000;255m***********************************
�[0m�[38;2;255;000;255m* Taichi Compiler Stack Traceback *
�[0m�[38;2;255;000;255m***********************************
�[0m�[38;2;255;000;255m/tmp/taichi-d8zh5g12/taichi_core.so: taichi::Logger::error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
�[0m�[38;2;255;000;255m/tmp/taichi-d8zh5g12/taichi_core.so: taichi::lang::opengl::initialize_opengl(bool)
�[0m�[38;2;255;000;255m/tmp/taichi-d8zh5g12/taichi_core.so(+0x785467) [0x7f8c011c7467]
�[0m�[38;2;255;000;255m/tmp/taichi-d8zh5g12/taichi_core.so(+0x63e79d) [0x7f8c0108079d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50abc5]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x509ce8]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x5081d5]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x516719]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: PyCFunction_Call
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x5081d5]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50a020]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x509ce8]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x509ce8]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x509ce8]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyFunction_FastCallDict
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyObject_FastCallDict
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyObject_CallMethodIdObjArgs
�[0m�[38;2;255;000;255m/usr/bin/python3.6: PyImport_ImportModuleLevelObject
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x5081d5]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x516719]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: PyCFunction_Call
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x5081d5]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50a020]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x509ce8]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x509ce8]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x509ce8]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyFunction_FastCallDict
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyObject_FastCallDict
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyObject_CallMethodIdObjArgs
�[0m�[38;2;255;000;255m/usr/bin/python3.6: PyImport_ImportModuleLevelObject
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x5081d5]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x516719]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: PyCFunction_Call
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x5081d5]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50a020]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;[Taichi] mode=development
[Taichi] preparing sandbox at /tmp/taichi-d8zh5g12
[Taichi] sandbox prepared
255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x509ce8]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x509ce8]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x509ce8]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x50aa1d]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyFunction_FastCallDict
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyObject_FastCallDict
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyObject_CallMethodIdObjArgs
�[0m�[38;2;255;000;255m/usr/bin/python3.6: PyImport_ImportModuleLevelObject
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _PyEval_EvalFrameDefault
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x5081d5]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: PyEval_EvalCode
�[0m�[38;2;255;000;255m/usr/bin/python3.6: ) [0x635082]
�[0m�[38;2;255;000;255m/usr/bin/python3.6: PyRun_FileExFlags
�[0m�[38;2;255;000;255m/usr/bin/python3.6: PyRun_SimpleFileExFlags
�[0m�[38;2;255;000;255m/usr/bin/python3.6: Py_Main
�[0m�[38;2;255;000;255m/usr/bin/python3.6: main
�[0m�[38;2;255;000;255m/lib/x86_64-linux-gnu/libc.so.6: __libc_start_main
�[0m�[38;2;255;000;255m/usr/bin/python3.6: _start
�[0mTraceback (most recent call last):
  File "/home/jenkins/taichi_cu100_py36/bin//ti", line 3, in <module>
    import taichi
  File "/home/jenkins/taichi_cu100_py36/python/taichi/__init__.py", line 2, in <module>
    from taichi.core import ti_core
  File "/home/jenkins/taichi_cu100_py36/python/taichi/core/__init__.py", line 1, in <module>
    from .util import ti_core, build, format, load_module, start_memory_monitoring, \
  File "/home/jenkins/taichi_cu100_py36/python/taichi/core/util.py", line 474, in <module>
    _print_taichi_header()
  File "/home/jenkins/taichi_cu100_py36/python/taichi/core/util.py", line 455, in _print_taichi_header
    if ti_core.with_opengl():
RuntimeError: [opengl_api.cpp:initialize_opengl@281] [glsl] cannot create GLFW window: error 65537: The GLFW library is not initialized

@archibate
Copy link
Collaborator Author

archibate commented Apr 26, 2020

This is because we only tolerate the error of GL Driver unavailable. Should we tolerate all errors then?
Let's exclude it in asia tmr. with_opengl should not have any side effects like ERROR.

@yuanming-hu
Copy link
Member

This is because we only tolerate the error of GL Driver unavailable. Should we tolerate all errors then?
Let's exclude it in asia tmr. with_opengl should not have any side effects like ERROR.

Thanks for the response. Yes, let's tolerate all errors.

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

Successfully merging this pull request may close these issues.

2 participants