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

Print function fails on GPU #115

Open
touste opened this issue Sep 3, 2018 · 5 comments
Open

Print function fails on GPU #115

touste opened this issue Sep 3, 2018 · 5 comments

Comments

@touste
Copy link

touste commented Sep 3, 2018

Hi everyone,
I've got an issue with the print or println function when running a simit program on the GPU, which makes debugging rather unconvenient.
In the simit linker log file, I get this message:
error : Undefined reference to 'printf' in '<compiled-ptx>'
Could you point me to where I could define this function?

Thanks

@fredrikbk
Copy link
Contributor

Hi @touste, I don't think the printing functionality will work on GPUs. Can you debug on the CPU?

@touste
Copy link
Author

touste commented Sep 4, 2018

Hi @fredrikbk, thanks for your reply. Yes I usually debug on the CPU however sometimes the program behaves a bit differently on the GPU. Not havint printing capabilities on the GPU is not a major issue, I was just wondering if there was an easy way to fix it.

@fredrikbk
Copy link
Contributor

Yes, that makes sense, but unfortunately I don't think NVidia GPUs support printing (unless it's been added without me noticing). The program behaving different is worrying though. Perhaps it's just the non-associativity of floating point numbers. I think once we get a shared-memory parallel implementation we'll be able to diagnose some of that using prints.

@fredrikbk
Copy link
Contributor

Aside, out of curiosity, what do you use Simit for? You might be interested in knowing that we have a new student here that will be picking it up, so it should start moving again.

@fredrikbk fredrikbk reopened this Sep 11, 2018
@touste
Copy link
Author

touste commented Sep 11, 2018

Hi Fredrik,
I'm not sure about printing support from the GPUs, although I think it's possible using cuda.

Regarding the different behaviour, here are 3 cases where I noticed a difference between CPU and GPU:

  1. Some functions are missing an implementation for the GPU, for example the cross function, or linear solver functions.
  2. If I modifying a scalar variable in the c++ file that is binded to a simit function between 2 function calls (using runsafe), it is not modified in the simit workspace.
  3. Some slightly different numerical results, but as you say it must be due to numerical errors.

Anyway, I'm glad Simit is picking up steam again. I'm using it to prototype a fast finite element code for real-time simulations of surgical procedures. In my case the GPU implementation comes handy, and SIMIT is a very efficient and elegant way to get high performance code without facing GPU programming.
You probably already have a lot of ideas for future development, but here are a few things that should be easy to implement and would improve performance a lot on my side:

  1. ability to launch different mapping functions simultaneously
  2. implementation of sparse system solvers for the gpu
  3. optimize gpu block size for each kernel

Thanks!

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

No branches or pull requests

2 participants