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

[vulkan] Support print() for Vulkan backend #2713

Closed
g1n0st opened this issue Aug 17, 2021 · 0 comments · Fixed by #6075
Closed

[vulkan] Support print() for Vulkan backend #2713

g1n0st opened this issue Aug 17, 2021 · 0 comments · Fixed by #6075
Assignees
Labels
discussion Welcome discussion! feature request Suggest an idea on this project vulkan Vulkan backend welcome contribution

Comments

@g1n0st
Copy link
Contributor

g1n0st commented Aug 17, 2021

Concisely describe the proposed feature

Currently, the Vulkan backend does not support the print function yet. print() will help users debug their codes more easily.

Describe the solution you'd like (if any)

Implementing print is adding an IR visitor for the PrintStmt statement, and you also need to create a buffer to store print messages and communicate between the host and the device. The OpenGL backend gives an excellent example to follow with. : )

@g1n0st g1n0st added feature request Suggest an idea on this project welcome contribution discussion Welcome discussion! vulkan Vulkan backend labels Aug 17, 2021
@ailzhang ailzhang self-assigned this Sep 15, 2022
ailzhang added a commit that referenced this issue Sep 19, 2022
Fixes #2713 

This is a long waited debugging utils that we finally get it done. Note
since debug printing requires validation layer support, you'll need to
have Vulkan SDK installed on your system to use it properly. For example
https://vulkan.lunarg.com/doc/sdk/1.3.224.1/linux/getting_started_ubuntu.html.
Also to enable debug printing on vulkan backend you'll need to make sure
`ti.init(..., debug=True)` so that we enable the validation layer
properly.

Nit: our test_print.py doesn't really validate the printed message but
I've run them with `-v -s` to verify the outputs visually.

Note: validation layer is not available on molten-vk so vulkan printing
on macos won't work.

TODO: 
- support on opengl backend.

Co-authored-by: PENGUINLIONG <[email protected]>
ailzhang added a commit that referenced this issue Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Welcome discussion! feature request Suggest an idea on this project vulkan Vulkan backend welcome contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants