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

v0.8.8 broke ti.random() on i915 with Vulkan backend #3857

Closed
whorfin opened this issue Dec 22, 2021 · 2 comments
Closed

v0.8.8 broke ti.random() on i915 with Vulkan backend #3857

whorfin opened this issue Dec 22, 2021 · 2 comments
Labels
potential bug Something that looks like a bug but not yet confirmed

Comments

@whorfin
Copy link

whorfin commented Dec 22, 2021

Describe the bug
ti.random() in @ti.kernel context causes crash in libvulkan_intel.so on i915 with Vulkan backend

To Reproduce

#!/usr/bin/python3
import taichi as ti

#ti.init(arch=ti.opengl) # works
ti.init(arch=ti.vulkan) # fail

N = 3

@ti.kernel
def randomize():
    for i in range(N):
        pos[i] = ti.random()


pos = ti.field(ti.f32, N)

print("\nNow initializing random array...",end="")
randomize()
print("done")

for i in range(N):
    print(pos[i])

When run with opengl backend:

[Taichi] version 0.8.8, llvm 10.0.0, commit 7bae9c77, linux, python 3.8.10
[Taichi] Starting on arch=opengl

Now initializing random array...done
0.7819478511810303
0.5993385314941406
0.48945173621177673

When run against Vulkan backend:

[Taichi] version 0.8.8, llvm 10.0.0, commit 7bae9c77, linux, python 3.8.10
[Taichi] Starting on arch=vulkan

Now initializing random array...[W 12/22/21 14:20:36.954 64993] [vulkan_device.cpp:rw_buffer@513] Overriding last binding
[E 12/22/21 14:20:36.954 64993] Received signal 11 (Segmentation fault)


***********************************
* Taichi Compiler Stack Traceback *
***********************************
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::Logger::error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so(+0x785d34) [0x7fe8c93d7d34]
/lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7fe8cdc9a210]
/usr/lib/x86_64-linux-gnu/libvulkan_intel.so(+0x484155) [0x7fe8c4c17155]
/usr/lib/x86_64-linux-gnu/libvulkan_intel.so(+0x10699c) [0x7fe8c489999c]
/usr/lib/x86_64-linux-gnu/libvulkan_intel.so(+0x108a61) [0x7fe8c489ba61]
/usr/lib/x86_64-linux-gnu/libvulkan_intel.so(+0x189d75) [0x7fe8c491cd75]
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so(+0xaa8f27) [0x7fe8c96faf27]
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::lang::vulkan::VulkanPipeline::create_compute_pipeline(taichi::lang::vulkan::VulkanPipeline::Params const&)
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::lang::vulkan::VulkanPipeline::VulkanPipeline(taichi::lang::vulkan::VulkanPipeline::Params const&)
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::lang::vulkan::VulkanDevice::create_pipeline(taichi::lang::PipelineSourceDesc const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::lang::vulkan::CompiledTaichiKernel::CompiledTaichiKernel(taichi::lang::vulkan::CompiledTaichiKernel::Params const&)
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::lang::vulkan::VkRuntime::register_taichi_kernel(taichi::lang::vulkan::VkRuntime::RegisterParams)
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::lang::compile_to_executable(taichi::lang::Kernel*, taichi::lang::vulkan::VkRuntime*)
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::lang::VulkanProgramImpl::compile(taichi::lang::Kernel*, taichi::lang::OffloadedStmt*)
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::lang::Program::compile(taichi::lang::Kernel&, taichi::lang::OffloadedStmt*)
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::lang::Kernel::compile()
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so: taichi::lang::Kernel::operator()(taichi::lang::Kernel::LaunchContextBuilder&)
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so(+0x3fc95a) [0x7fe8c904e95a]
/usr/local/lib/python3.8/dist-packages/taichi/_lib/core/taichi_core.so(+0x3b643e) [0x7fe8c900843e]
/usr/bin/python3: PyCFunction_Call
/usr/bin/python3: _PyObject_MakeTpCall
/usr/bin/python3: ) [0x50b485]
/usr/bin/python3: PyObject_Call
/usr/bin/python3: ) [0x59cb20]
/usr/bin/python3: _PyObject_MakeTpCall
/usr/bin/python3: _PyEval_EvalFrameDefault
/usr/bin/python3: _PyEval_EvalCodeWithName
/usr/bin/python3: _PyFunction_Vectorcall
/usr/bin/python3: PyObject_Call
/usr/bin/python3: _PyEval_EvalFrameDefault
/usr/bin/python3: _PyEval_EvalCodeWithName
/usr/bin/python3: _PyFunction_Vectorcall
/usr/bin/python3: _PyObject_FastCallDict
/usr/bin/python3: _PyObject_Call_Prepend
/usr/bin/python3: ) [0x59cafb]
/usr/bin/python3: PyObject_Call
/usr/bin/python3: _PyEval_EvalFrameDefault
/usr/bin/python3: _PyEval_EvalCodeWithName
/usr/bin/python3: _PyFunction_Vectorcall
/usr/bin/python3: _PyEval_EvalFrameDefault
/usr/bin/python3: _PyEval_EvalCodeWithName
/usr/bin/python3: PyEval_EvalCode
/usr/bin/python3: ) [0x67cd01]
/usr/bin/python3: ) [0x67cd7f]
/usr/bin/python3: ) [0x67ce21]
/usr/bin/python3: PyRun_SimpleFileExFlags
/usr/bin/python3: Py_RunMain
/usr/bin/python3: Py_BytesMain
/lib/x86_64-linux-gnu/libc.so.6: __libc_start_main
/usr/bin/python3: _start

Internal error occurred. Check out this page for possible solutions:
https://docs.taichi.graphics/lang/articles/misc/install

Here is the diagnostic info:

$ ti diagnose
[Taichi] version 0.8.8, llvm 10.0.0, commit 7bae9c77, linux, python 3.8.10

*******************************************
**      Taichi Programming Language      **
*******************************************

Docs:   https://docs.taichi.graphics/
GitHub: https://github.com/taichi-dev/taichi/
Forum:  https://forum.taichi.graphics/

Taichi system diagnose:

python: 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0]
system: linux
executable: /usr/bin/python3
platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.29
architecture: 64bit ELF
uname: uname_result(system='Linux', node='shiv', release='5.4.0-91-generic', version='#102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021', machine='x86_64', processor='x86_64')
locale: en_US.UTF-8
PATH: /home/whorfin/bin:/home/whorfin/bin.private:/home/whorfin/bin:/home/whorfin/bin.private:/home/whorfin/.local/bin:/home/whorfin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/whorfin/.fzf/bin:/usr/local/texlive/2018/bin/x86_64-linux:/home/whorfin/.cargo/bin
PYTHONPATH: ['/usr/local/bin', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/whorfin/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/local/lib/python3.8/dist-packages/cc2538_bsl-2.1.post47+g0daa5d0-py3.8.egg', '/usr/lib/python3/dist-packages']

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal



import: <module 'taichi' from '/usr/local/lib/python3.8/dist-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.8, llvm 10.0.0, commit 7bae9c77, linux, python 3.8.10

[Taichi] version 0.8.8, llvm 10.0.0, commit 7bae9c77, linux, python 3.8.10
[Taichi] Starting on arch=x64

[Taichi] version 0.8.8, llvm 10.0.0, commit 7bae9c77, linux, python 3.8.10
[Taichi] Starting on arch=opengl

[W 12/22/21 14:22:50.743 65173] [cuda_driver.cpp:CUDADriver@38] CUDA driver not found.
[W 12/22/21 14:22:50.744 65173] [__init__.py:adaptive_arch_select@1110] Arch=[<Arch.cuda: 5>] is not supported, falling back to CPU
[Taichi] version 0.8.8, llvm 10.0.0, commit 7bae9c77, linux, python 3.8.10
[Taichi] Starting on arch=x64

[Taichi] version 0.8.8, llvm 10.0.0, commit 7bae9c77, linux, python 3.8.10

*******************************************
**      Taichi Programming Language      **
*******************************************

Docs:   https://docs.taichi.graphics/
GitHub: https://github.com/taichi-dev/taichi/
Forum:  https://forum.taichi.graphics/

Running example minimal ...
[Taichi] Starting on arch=x64
42.0
>>> Running time: 0.22s
42

Consider attaching this log when maintainers ask about system information.
>>> Running time: 3.89s

And this might additionally be helpful - I do not see the crash on nvidia hardware. I see the crash with Vulkan on this hardware:

$ inxi -G
Graphics:  Device-1: Intel HD Graphics 620 driver: i915 v: kernel
           Display: x11 server: X.Org 1.20.11 driver: modesetting unloaded: fbdev,vesa
           resolution: 2560x1440~60Hz
           OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.0.3
@whorfin whorfin added the potential bug Something that looks like a bug but not yet confirmed label Dec 22, 2021
@strongoier
Copy link
Contributor

cc: @bobcao3 @AmesingFlank

@whorfin
Copy link
Author

whorfin commented Mar 1, 2022

seems fixed in 0.9.0

@whorfin whorfin closed this as completed Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug Something that looks like a bug but not yet confirmed
Projects
None yet
Development

No branches or pull requests

2 participants