Strange results using ngsolve.ngscuda.UnifiedVector

Hi everyone,

after compiling ngsolve with cuda-support, I tried to run the
basic examples from ngscuda/examples/
The results are not as expected (see the listing below).
Does anyone have any idea what could be causing this?
I have not found any clues in the documentation.
Thank you,


unified2.html (271.4 KB)

HI Mre,

Could you please share the CMAKE flag when compling NGSolve with me?
Thank you in advance.

Best regards,

Hi VienC,

thanks for your reply. Below you’ll find the Dockerfile I used for compiling ngsolve.


Dockerfile (1.6 KB)

1 Like

Hi Martin,

thank you for the bug report, is fixed with my commit from yesterday.
Should work with --branch v6.2.2307, or with master-branch

Best, Joachim

Hello Joachim,

Thank you very much for your message. I’ll try out the new version soon.
Merry Christmas,


Hello Joachim,

I compiled the new version (‘6.2.2307-7-gacaa2a3a3’) but still
have some problems to interpret the results (see the file below).
Why do I get an all zero result vector in the final print statement?
May be I misunderstood how to handle UnifiedVectors.
Could you please give me a hint?

unified_2307.html (269.6 KB)

Hello Joachim,

I am still wondering how to use UnifiedVectors. In the example below
I start with a numpy array and use it to generate a corresponding
UnifiedVector. This correctly allocates memory on the GPU.
Then I define u2 = u + u followed by u2e = u2.Evaluate(), which
also allocates some memory on the GPU.
The next step is u2e.UpdateHost() to copy the result from GPU
to CPU. But when I print u2e, all components are 0.
I’ve got the impression, that calling UpdateHost() has no effect
at all.
It would be nice to get some help on this issue.
Best regards,