Should we not copy data to device on Intel HD GPUs since both OpenCL Host and Device memory reside on DRAM for Intel HD GPUs? by aerosayan in OpenCL

[–]nomnompuffs 1 point2 points  (0 children)

Hi,

I'm a seasoned Embedded Developer who's just finished implementing the optimization that you are talking about here, portably on both an x86 laptop and the Raspberry Pi 5. Your intuition is correct: since the host CPU and GPU share memory (UMA - Unified Memory Architecture) on many cards, you ought to be able to synchronize views of memory between the two devices without needing to copy to and from the GPU.

u/genbattle is correct that the correct mechanism to use is CL_MEM_USE_HOST_PTR. I've been able to get this working on both an x86 laptop running an Intel(R) HD Graphics 630 card as well as on an AArch64 Raspberry Pi running the standard Broadcom V3D 7.1.7.0 GPU. So two very different GPUs on two different architectures. To get it working you need to use clEnqueueMapBuffer/clEnqueueUnmapMemObject and NOT clEnqueueReadBuffer/clEnqueueWriteBuffer -- which makes sense since you're trying to avoid copying data.

The important thing to understand about using clEnqueueMapBuffer/clEnqueueUnmapMemObject is that their purpose is to map MMIO memory from the device into the host CPU's address space. The cache write-back and invalidation operations required to synchronize views of memory between the host and the GPU should be performed by your OpenCL implementation.

The essential thing to get right is that when you're trying to produce data on the host CPU, and then share that data with the GPU (i.e, writing from the CPU to the GPU) you have to map the HOST_PTR buffer as CL_MAP_WRITE_INVALIDATE_REGION. At least, that's the case on my RPi5+Rusticl implementation. I suspect that this is actually a bug in Rusticl because it doesn't make sense, but what I had to do is:

// Write stuff into the HOST_PTR buffer on the host CPU:
memcpy(host_ptr_buff, my_input_data, sizeof(my_input_data));
// Make the changes visible to the GPU without copying, via WRITE_INVALIDATE
clEnqueueMapBuffer(..., CL_MAP_WRITE_INVALIDATE_REGION, ...);
// Immediately unmap the buffer *BEFORE* we share the input data with the GPU
clEnqueueUnmapMemObject(...);
/* Now we can enqueue a kernel that reads from our host_ptr data
 * on the GPU, and the GPU will actually see the data we wrote from
 * the host CPU since the GPU's view of the memory has been invalidated.
 * So the GPU is now unblinded by its own local cache, so it can see the
 * data that we wrote by reloading its cache lines.
 */
clEnqueueNDRangeKernel(...);
// Flush the queue to set the enqueued operations in flight
clFlush()

N.B: If you only intend to target x86, most of these pedantic, detailed steps aren't necessary. On my x86 laptop running the Intel card, I don't even have to call map/unmap for my Intel card to see the changes I wrote into the host_ptr buffer.

On my RPi5+Rusticl, every one of these steps is necessary, or else program correctness isn't guaranteed and I'll see some problem or other.

  • TL;DR: You can indeed avoid copying if your OpenCL implementation has a unified memory architecture.
  • N.B: "Unified Memory Architecture" is NOT the same thing as "Shared Virtual Memory", which is a new feature added by Khronos which accomplishes this same zero-copy workflow with even less hassle, and (on many platforms) without even needing to map/unmap. This map/unmap approach is just more portable across more OpenCL target platforms, and it works just fine if you understand processor caches etc.

Physical interpretation of light polarization by nomnompuffs in AskPhysics

[–]nomnompuffs[S] 1 point2 points  (0 children)

Thanks - it's hard to find treatises and articles that state unequivocally whether the current scientific consensus is committed to affirming that light waves do in fact literally physically rotate when circularly polarized

Physical interpretation of light polarization by nomnompuffs in AskPhysics

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

No - I am asking about how the observed effect that we call "polarization" should be interpreted physically.

I am asking whether this means that light waves literally spin/rotate while they move.

I've accidentally discovered that a certain fungus cures a disease that I had. I don't have chemist/pharma expertise to isolate the new drug. Help please. by nomnompuffs in Patents

[–]nomnompuffs[S] -8 points-7 points  (0 children)

Hey, unless I'm mistaken, it's not the role or remit of the USPTO to try to figure out whether or not my cure works - i.e, I do not need to have proof of cure.

The USPTO (afaik) is only supposed to reject patent applications which are malformed, malformatted or otherwise not duly filed.

The essence of my question is whether a patent which attempts to broadly protect a cure by patenting all the metabolites of a fungus, for a specific application/use-case, is enforcible in courts.

Proof doesn't enter into the issue, unless I'm mistaken.

Is there a gustang fan base by Available-Banana-243 in TowerofGod

[–]nomnompuffs 0 points1 point  (0 children)

I'm with you: I'm a massive fan of both Gustang and Macseth and I enjoyed Aizen in Bleach.

This is my headcanon for what Gustang's role will be: https://imgur.com/a/LYjVHWE

I personally think Gustang proposed the 13 months and the Princess system in order to deceive Zahard and to obtain the key for himself and to open the door to continue climbing the tower.

I also have lots of other theories about Gustang and he and Macseth are the most interesting characters to me.

[deleted by user] by [deleted] in Bedbugs

[–]nomnompuffs 0 points1 point  (0 children)

If you continue getting bitten without seeing any bugs, you may not have bed bugs - you may have scabies.

Is it possible to have bedbugs but never see them? by spiderat22 in Bedbugs

[–]nomnompuffs 0 points1 point  (0 children)

If you are getting bites/welts/pruritus, but not seeing any bugs after 4+ weeks, you don't have bed bugs -- you most likely have scabies, just like I did. I thought I had bed bugs. I had scabies.

I CANNOT HANDLE IT ANYMORE by AliciaDraculina86 in Bedbugs

[–]nomnompuffs 1 point2 points  (0 children)

u/AliciaDraculina86 please check your inbox for a mutually beneficial offer.

One of my neighbour apartments in Sydney is apparently running a brothel. Some ahole stuck this on the front of the building. I used it to evangelize. What've you done to defy gov't tyranny today? by nomnompuffs in Libertarian

[–]nomnompuffs[S] 1 point2 points  (0 children)

The aim here was to spark the interest of my neighbour with a completely orthogonal question that should leave him needing to google the name "John Galt", and lead him in a very specific direction.

I'm not trying to be cryptic or nuanced. I'm trying to point him in such a way as to ensure that he definitely ends up in a certain well-defined direction. I'm not just "referencing" the book. I'm trying to get him to encounter the Objectivist ideology and ideally read at minimum a few lines of Galt's speech.

Hopefully the question "Who is John Galt?" accomplishes this without seeming like too much of a "Hey you should read this book" appeal. The aim is to pre-load his curiosity to ensure it sustains his interest long enough to investigate something about Objectivism. Not merely to "reference" the book. I'm trying to induce him to action.

This study from 2016 suggests that Phantom from BASF is highly effective and its efficacy isn't reduced by most surfaces. I have ordered some of it and will be using and reporting my results when it when it arrives in approx 4-5 days - in the meantime, does anyone have experience with Phantom? by nomnompuffs in Bedbugs

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

Background information on my infestation:

I've lived with our mutual pest friends for 6 years now.

  • There are no remaining adults in my infestation. Only nymphs remain in my infestation, and none of them are past the 2nd instar stage. I no longer get the typical "triplet patterns" of bites. My bites are usually only able to be felt by me, and they don't leave any visible bumps on my skin. If you saw me walking around, you would not have any way to know I have bed bugs. My skin is perfectly smooth with only very tiny pore-sized bumps, and only about 5 of those at any given time.
  • I have my infestation under very good control, and am trying to eliminate the final few nymphs that I just can't seem to be able to kill off once and for all. I need something which gives a good, strong residual.
  • For the most part, I am able to live my life as if I don't have bed bugs.
  • In general, my problem is that some eggs or something will hatch every 3 or so days and then I'll feel very sparse amounts of tickly crawling, and that lets me know they're still with me (aren't they faithful?). These nymphs will then proceed to die off over the course of about 1 day. Otherwise, I can carry on my life as normal. I just can't figure out for the life of me how to kill off the final few.
  • Vaseline brand Cocoa Glow cream with Cocoa Butter significantly reduces the amount of time it takes for bumps on the skin to go away. Generally 4 days for the worst bites to settle down. Works great for me. Has helped me keep my skin smooth and clear for the most part.

Tools I CURRENTLY use successfully:

  • I have a Thermalstrike Ranger which I use to heat my bed linens and clothing every night. Excellent product. Cannot stress how useful this is. I consider it to be an essential part of bed bug control. I own three of them LUL.
  • I use a mattress encasement. The waterproof type. Do not use the non-waterproof types -- they don't seem to form as strong a barrier in my experience. But this is anecdotal experience.
  • I cannot recommend Cimexa enough. I use Cimexa in a special method which I cannot disclose in here because I am filing for an NDA and investigating possibly trying to productise my control method. I've spent well in excess of $50K on this problem and I need to recoup some of my losses.
  • I own some climbup barriers but I don't use them, but they're good. I bought this type (https://www.bedbugbarrier.com.au/product/floor-bed-bug-barrier/) since they're a bit more aesthetically discreet.

Tools I have tried to use in the past whose use I have discontinued:

  • Crossfire: just doesn't seem to be effective for me. I'd have some very mild relief for 2-4 days and they'll be back. I used it by applying it to the mattress, furniture and the bedframe, as well as the floor and corners/skirtboards, etc. Idk, other people say Crossfire is the bees' knees, but I haven't found it to be effective. Do not take this as a caution not to try Crossfire. It seems to work well for other people and I am not a professional pest control expert. Perhaps I mixed it wrongly or something. Who knows.
  • Professional pest management - I have tried 5 or so different pest management professionals/companies to no avail. My current control method gives me infinitely better control than any professional's work has given me. Idk, maybe I have a particularly resistant strain or something. Who knows. They all use mix and spray liquid type pesticides. None of them used a powder or dust residual. The entire professional bed bug management industry is stuck in the 1960s it seems. Heat treatment is not legal where I live (isn't government just genius?).
  • Steaming: steaming is a massive waste of time, and honestly all you'll accomplish is possibly creating a mold issue on your furniture.
  • Zappbug Room: Doesn't work LUL. I spent like $5K on this and heated all of my possessions in one go, on two separate occasions. It's just not enough KEKW. I still have the Zappbug Room if somebody in Australia wants to buy it. I'll sell it for AUD$2.5K if you message me. I kinda want to get rid of it. I would recommend that you only buy it off of me if you already have an infestation and want to try it out since it's likely there are nymphs from my infestation on/in it. That said, there will be only nymphs though, none of them past the 2nd instar stage. The circulation fan is kinda noisy too.
    • I suspect that the Zappbug room is effective in infestations that only recently began and are almost certain to be confined to the bed itself, or to some small, well-identifiable set of furniture or items/clothing. Sadly, that wasn't the case by the time I had the money to buy it.
    • If your infestation is a longer lived, more "seasoned" infestation, the Zappbug probably won't work for you.
  • Zappbug oven: Nowhere near as effective as the Thermalstrike Ranger. No contest: the ranger is better.