Repository navigation
GPU: give the device propagator the device address of the material table - #16244
Conversation
UpdateGPUCalibObjects prepares the device copy of the o2::base::Propagator in the host shadow of the flat calib objects. It sets the GPU field to its device address, but the material table to the address of the host shadow copy, mFlatObjectsShadow.mCalibObjects.matLUT, instead of the device one. On backends that cannot dereference host memory from the device, the material lookups of the GPU refit with the O2 track model, of the TRD tracking with the O2 propagator and of the ITS GPU tracking then do not find the table, so no material correction is applied (seen on Metal). On CUDA and HIP the host memory pool is pinned and mapped, so this presumably works, but the device code reads the table header over the bus.
|
@davidrohr spotted while letting my friends port ITS code to Metal where things don't work because "Unified Memory" != "same address space". |
|
Obivously right. I am really wondering why it never failed before... It is not that all GPUs would use unified memory... |
|
You mean unified virtual address? Apparently compute capabilities 2.0 and most of the hip supported GPUs, so it does go quite back in the past. |
|
Yes, but originally it had different address spaces, like metal now, and also afterwards one had to use cudaMallocHost, and sometimes set some options. But yes, it might just work out of the box. In that case, we should actually find a way to disable it, to avoid hidden performance bottlenecks when the GPU accesses host memory via a unified address space.... I'll put it on my todos to invetigate this. |
|
Yes, that (the hidden performance issues) is what I was thinking about as well. |
UpdateGPUCalibObjects prepares the device copy of the o2::base::Propagator in
the host shadow of the flat calib objects. It sets the GPU field to its device
address, but the material table to the address of the host shadow copy,
mFlatObjectsShadow.mCalibObjects.matLUT, instead of the device one.
On backends that cannot dereference host memory from the device, the material
lookups of the GPU refit with the O2 track model, of the TRD tracking with the
O2 propagator and of the ITS GPU tracking then do not find the table, so no
material correction is applied (seen on Metal). On CUDA and HIP the host
memory pool is pinned and mapped, so this presumably works, but the device
code reads the table header over the bus.