Skip to content

Time Synchronization Problem between GPU and CPU in NPKit #32

Description

@ZhiyiHu1999

Hello! In NPKit, we have a thread NpKit::CpuTimestampUpdateThread() looping to update the cpu timetamp and the updated value is given to a pointer cpu_timestamp_. To synchronize between CPU and GPU, NPKit has CPU SYNC event and GPU SYNC event happening at almost the same time and documents the values read from the pointer cpu_timestamp_ and clock64().

However, from my experiments, I think the cpu timestamp obtained in CPU SYNC event is not the correct value because cache coherence in the system may not be strong enough to ensure every update in the NpKit::CpuTimestampUpdateThread() writes to the memory and we may not get the most up-to-date value in CPU SYNC event even if we always use volatile in the code. Could I ask whether your team have noticed the problem and do you have any way to settle it? Thanks a lot!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions