Skip to content

GPU: give the device propagator the device address of the material table - #16244

Merged
davidrohr merged 1 commit into
AliceO2Group:devfrom
ktf:pr16244
Nov 30, 2026
Merged

davidrohr merged 1 commit into
AliceO2Group:devfrom
ktf:pr16244

Conversation

@ktf

@ktf ktf commented Nov 30, 2026

Copy link
Copy Markdown
Member

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.

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.
@ktf
ktf requested a review from davidrohr as a code owner November 30, 2026 19:44
@ktf

ktf commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

@davidrohr spotted while letting my friends port ITS code to Metal where things don't work because "Unified Memory" != "same address space".

@davidrohr

Copy link
Copy Markdown
Collaborator

Obivously right. I am really wondering why it never failed before... It is not that all GPUs would use unified memory...

@davidrohr
davidrohr merged commit b6c4fb3 into AliceO2Group:dev Nov 30, 2026
8 of 11 checks passed
@ktf

ktf commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

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.

@davidrohr

Copy link
Copy Markdown
Collaborator

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.

@ktf

ktf commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

Yes, that (the hidden performance issues) is what I was thinking about as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants