taichi: ti.init(arch=ti.opengl) failed with Taichi 0.8.1
Describe the bug
With Taichi 0.8.1, ti.init(arch=ti.opengl) doesn’t work.
Btw, ti.opengl with v0.7.32 and ti.cpu with v0.8.1 both work.
To Reproduce A minimal Python file to reproduce:
import taichi as ti
ti.init(arch=ti.opengl)
Log/Screenshots Full error message:
(venv) kyc@kyc-T470p:~$ python3 example.py
[Taichi] version 0.8.1, llvm 10.0.0, commit cc2dd342, linux, python 3.8.10
[Taichi] Starting on arch=opengl
[E 09/30/21 23:36:16.302 52849] [opengl_device.cpp:check_opengl_error@30] glClearBufferSubData: GL_INVALID_OPERATION
***********************************
* Taichi Compiler Stack Traceback *
***********************************
/home/kyc/venv/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::Logger::error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
/home/kyc/venv/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::opengl::check_opengl_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
/home/kyc/venv/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::opengl::GLCommandList::CmdBufferFill::execute()
/home/kyc/venv/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::opengl::GLStream::submit(taichi::lang::CommandList*)
/home/kyc/venv/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::opengl::GLStream::submit_synced(taichi::lang::CommandList*)
/home/kyc/venv/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::opengl::OpenGlRuntime::OpenGlRuntime()
/home/kyc/venv/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::OpenglProgramImpl::materialize_runtime(taichi::lang::MemoryPool*, taichi::lang::KernelProfilerBase*, unsigned long**)
/home/kyc/venv/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so(+0x45aaeb) [0x7fcac84feaeb]
/home/kyc/venv/lib/python3.8/site-packages/taichi/core/../lib/taichi_core.so(+0x39ad2e) [0x7fcac843ed2e]
python3(PyCFunction_Call+0x59) [0x5f2cc9]
python3(_PyObject_MakeTpCall+0x150) [0x5f3010]
python3() [0x50bf55]
python3(_PyEval_EvalFrameDefault+0x57d7) [0x56fb87]
python3(_PyEval_EvalCodeWithName+0x26a) [0x568d9a]
python3(_PyFunction_Vectorcall+0x393) [0x5f5b33]
python3(_PyEval_EvalFrameDefault+0x18eb) [0x56bc9b]
python3(_PyEval_EvalCodeWithName+0x26a) [0x568d9a]
python3(PyEval_EvalCode+0x27) [0x68cdc7]
python3() [0x67e161]
python3() [0x67e1df]
python3() [0x67e281]
python3(PyRun_SimpleFileExFlags+0x197) [0x67e627]
python3(Py_RunMain+0x212) [0x6b6e62]
python3(Py_BytesMain+0x2d) [0x6b71ed]
/lib/x86_64-linux-gnu/libc.so.6: __libc_start_main
python3(_start+0x2e) [0x5f96de]
Internal error occurred. Check out this page for possible solutions:
https://docs.taichi.graphics/docs/lang/articles/misc/install
Traceback (most recent call last):
File "example.py", line 3, in <module>
ti.init(arch=ti.opengl)
File "/home/kyc/venv/lib/python3.8/site-packages/taichi/lang/__init__.py", line 439, in init
impl.get_runtime().prog.materialize_runtime()
RuntimeError: [opengl_device.cpp:check_opengl_error@30] glClearBufferSubData: GL_INVALID_OPERATION
Additional comments
Output of ti diagnose:
(venv) kyc@kyc-T470p:~$ ti diagnose
[Taichi] version 0.8.1, llvm 10.0.0, commit cc2dd342, linux, python 3.8.10
*******************************************
** Taichi Programming Language **
*******************************************
Docs: https://taichi.rtfd.io/en/stable
GitHub: https://github.com/taichi-dev/taichi
Forum: https://forum.taichi.graphics
Taichi system diagnose:
python: 3.8.10 (default, Jun 2 2021, 10:49:15)
[GCC 9.4.0]
system: linux
executable: /home/kyc/venv/bin/python3
platform: Linux-5.11.0-36-generic-x86_64-with-glibc2.29
architecture: 64bit ELF
uname: uname_result(system='Linux', node='kyc-T470p', release='5.11.0-36-generic', version='#40~20.04.1-Ubuntu SMP Sat Sep 18 02:14:19 UTC 2021', machine='x86_64', processor='x86_64')
locale: en_US.UTF-8
PATH: /home/kyc/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PYTHONPATH: ['/home/kyc/venv/bin', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/kyc/venv/lib/python3.8/site-packages', '/home/kyc/venv/lib/python3.8/site-packages/taichi/core/../lib']
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
import: <module 'taichi' from '/home/kyc/venv/lib/python3.8/site-packages/taichi/__init__.py'>
cc: False
cpu: True
metal: False
opengl: True
cuda: False
vulkan: True
`glewinfo` not available: [Errno 2] No such file or directory: 'glewinfo'
`nvidia-smi` not available: [Errno 2] No such file or directory: 'nvidia-smi'
[Taichi] version 0.8.1, llvm 10.0.0, commit cc2dd342, linux, python 3.8.10
[Taichi] version 0.8.1, llvm 10.0.0, commit cc2dd342, linux, python 3.8.10
[Taichi] Starting on arch=x64
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/kyc/venv/lib/python3.8/site-packages/taichi/lang/__init__.py", line 439, in init
impl.get_runtime().prog.materialize_runtime()
RuntimeError: [opengl_device.cpp:check_opengl_error@30] glClearBufferSubData: GL_INVALID_OPERATION
Taichi OpenGL test failed: Command '['/home/kyc/venv/bin/python3', '-c', 'import taichi as ti; ti.init(arch=ti.opengl)']' returned non-zero exit status 1.
[W 09/30/21 23:42:04.918 53403] [__init__.py:adaptive_arch_select@953] Arch=[<Arch.cuda: 5>] is not supported, falling back to CPU
[Taichi] version 0.8.1, llvm 10.0.0, commit cc2dd342, linux, python 3.8.10
[Taichi] Starting on arch=x64
[Taichi] version 0.8.1, llvm 10.0.0, commit cc2dd342, linux, python 3.8.10
*******************************************
** Taichi Programming Language **
*******************************************
Docs: https://taichi.rtfd.io/en/stable
GitHub: https://github.com/taichi-dev/taichi
Forum: https://forum.taichi.graphics
Running example minimal ...
[Taichi] Starting on arch=x64
>>> Running time: 0.36s
42
Consider attaching this log when maintainers ask about system information.
>>> Running time: 9.40s
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (3 by maintainers)
I think I have a rough idea why this might be happening, but in the meantime maybe use the Vulkan backend, features wise Vulkan has multiple Snode root and GL has a semi working global dynamic field, but I do suggest using Vulkan backend if it works for you!
On Thu, Sep 30, 2021, 9:30 PM Y7K4 @.***> wrote:
OpenGL backend works at both
4741216fanded7fa26e, and it fails starting fromb510e807([opengl] Move old runtime onto Device API (#2945)). I don’t have any idea how to fix though.Hello! Which GPU do you have? Also can you try the Vulkan backend?
On Thu, Sep 30, 2021, 8:46 PM Y7K4 @.***> wrote: