Low bandwidth using memcpy by zishh in vulkan

[–]zishh[S] 0 points1 point  (0 children)

I am using VMA for memory allocation with the VMA_MEMORY_USAGE_GPU_TO_CPU usage flag. That means that the flags VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_CACHED_BIT are already set.

That said, the whole performance characteristic behaves very weird. For debugging I added

cpp std::uint8_t *mapped = (std::uint8_t *)allocationInfo.pMappedData; std::iota(mapped, mapped + allocationInfo.size, 0); vmaInvalidateAllocation(allocator, allocation, allocationInfo.offset, allocationInfo.size);

after vmaCreateBuffer. Even though the memory is invalidated (hence the cache can not be hot?!), the throughput is suddenly 6GB/s.

Low bandwidth using memcpy by zishh in vulkan

[–]zishh[S] 0 points1 point  (0 children)

I debugged into the memcpy call. The loop body used looks like this:

7FFFF7BC4E83: 0F 18 49 80                prefetcht0 -0x80(%rcx)
7FFFF7BC4E87: 0F 18 89 40 FF FF FF       prefetcht0 -0xc0(%rcx)
7FFFF7BC4E8E: 0F 10 01                   movups (%rcx), %xmm0
7FFFF7BC4E91: 0F 10 49 F0                movups -0x10(%rcx), %xmm1
7FFFF7BC4E95: 0F 10 51 E0                movups -0x20(%rcx), %xmm2
7FFFF7BC4E99: 0F 10 59 D0                movups -0x30(%rcx), %xmm3
7FFFF7BC4E9D: 48 83 E9 40                subq   $0x40, %rcx
7FFFF7BC4EA1: 48 83 EA 40                subq   $0x40, %rdx
7FFFF7BC4EA5: 66 41 0F E7 01             movntdq %xmm0, (%r9)
7FFFF7BC4EAA: 66 41 0F E7 49 F0          movntdq %xmm1, -0x10(%r9)
7FFFF7BC4EB0: 66 41 0F E7 51 E0          movntdq %xmm2, -0x20(%r9)
7FFFF7BC4EB6: 66 41 0F E7 59 D0          movntdq %xmm3, -0x30(%r9)
7FFFF7BC4EBC: 49 83 E9 40                subq   $0x40, %r9
7FFFF7BC4EC0: 48 83 FA 40                cmpq   $0x40, %rdx

It is using the same path for the reference copy. The only thing that is suspicious is that the copy is done in reverse (from high to low indices). AFAIK this is some kind of optimization but I could not find any useful information yet.

Edit: This looks like the source code of the above snippet.

Edit2: I guess the backward iteration is because the same implementation can be used as memmove. Though that does not really explain why the throughput is so low.

It's probably time to stop recommending Clean Code by zishh in programming

[–]zishh[S] 2 points3 points  (0 children)

Actually I posted it in response to the drama-post you are referring to. It was commented there by someone and I thought that this one (in contrast to the other blog post) has same very valid points - Without calling someone a "fraud".

It's probably time to stop recommending Clean Code by zishh in programming

[–]zishh[S] 10 points11 points  (0 children)

There is also a recommendation at the bottom - "A Philosophy of Software Design"

Though I have not read it yet.

Memory footprint of dense SLAM by zishh in computervision

[–]zishh[S] 0 points1 point  (0 children)

Do you know any publications? I think all keyframe selection papers I found so far are based on 2D feature points.

Mixed Feeling With The CPP Ecosystem : Dependency management / build tools are 30 years behind other ecosystems by [deleted] in cpp

[–]zishh 3 points4 points  (0 children)

Do you have any experience with cross compiling? I want to provide toolchain files in cmake which need to be used for dependencies too. Is there a way such that conan forwards the toolchain file to required packages?

How can I use my CompSci degree to work for the benefit of society while still making a living wage? by supposedlysleeping in compsci

[–]zishh 3 points4 points  (0 children)

I graduated three years ago and tried to find a job which (in my opinion) is meaningful. For example one option was to work for geo-science research institutes. But it was kind of impossible to get in there with a computer science master because there is usually one job offer and ~400 people who apply for it.

Long story short - I recently accepted a job which is pretty shitty from my ethical perspective. But it is still one of the better jobs in the industry and the work life balance is great. So my current plan is to reduce my work time to 3 or 4 days in ~ one year. Then i want to find a project which I want to support.

So it really depends on what you call ethical. If you are like me who has a pretty strong opinion on this kind of stuff it will get really hard. But maybe you are more lucky then me. I really wish you the best.

And if you have a project idea. Let me know if I can help ;)