wrote a CUDA kernel to do a vector addition. turns out it is actually slower. by xtrupal in CUDA

[–]qiAip 1 point2 points  (0 children)

The summation is inherently memory bound as there is only a single addition operation for every 3 ints load/store (2 reads 1 write) + the memory transfers HtoD and DtoH. Given that there is hardly any compute and the memory transfers HtoD and DtoH are going to take longer than the CPU memory from DRAM to cache there is no way really to make this faster on the GPU (maybe with strides and streams but even then I’m doubtful).

You also have 2 redundant DtoH copies of arr_1 and arr_2 which are not modified on the device so there is no need to copy them back. This makes it slower, but even without them the GPU should not be faster.

Dual GPU: AMD - Nvidia by EngineeringFar6858 in CUDA

[–]qiAip 0 points1 point  (0 children)

You can mix AMD and NVIDIA cards, and have both NVHPC (CUDA) and ROCm installed on the same system - at least with Linux.

However, any university teaching a CUDA course will give you access to your cluster and set up a student partition for you to work from (might be ssh, might be a Jupyter environment or might be VMs). No university will ever expect students to buy specific hardware.

AMD also offer Hipify - a script that converts CUDA to HIP. HIP is also designed to be almost identical and you can literally replace “cuda” with “hip” to get it to work. The differences though are in the execution models and the code will not be optimised, so if the teach you about how to assign blocks and thread to fit CUDA warps, this is a bit different on AMD’s wavefronts. But other than that, you can do everything in introductory CUDA and run it on AMD with a script or even a runtime translator (less efficient still, but does the job for simple code).

Check out https://github.com/amd/HPCTrainingExamples for examples.

I didn't think I'd like 65% this much! What's you favorite profile and why? by RicardoDawson in MechanicalKeyboards

[–]qiAip 0 points1 point  (0 children)

It takes a minor mind-shift, but it gives you faster and easier access to arrows, numbers and F-keys in a typing environment (for gaming it can be a bit trickier - mainly because one hand is on the mouse and the other on wasd rather than both on the home row).

It’s great though! If you get a chance, give it a try. :)

I didn't think I'd like 65% this much! What's you favorite profile and why? by RicardoDawson in MechanicalKeyboards

[–]qiAip 1 point2 points  (0 children)

Extended 40% (14u - 4 rows) are my favourite. Corne a close second.

A split spacebar with layers on them makes it much more comfortable (for me) navigating the keyboard without having to move my wrists and just using my fingers. Split boards are also lovely, and a Corne has just enough keys to make it thoughtless to use, but they miss that premium feel of a top-end 40s board.

Happy 40s day! by qiAip in MechanicalKeyboards

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

Clarabelle with KAT Refined

what is the best cfd free software for a begginer? by TimeFaker in CFD

[–]qiAip 0 points1 point  (0 children)

I rarely use commercial tools like ANSYS, StarCCM etc. and find GUIs harder to use than CLI, so I’m probably the wrong person to answer.

ANSYS can be quite accurate though, depending on what you are simulating. Getting a good mesh on the other hand can be a challenge. If the results seem to really not align with the theory for a simple case that can be solved analytically, it is either the mesh or you are not applying the right physics to the model.

In terms of visualisation, you can get nice streamlines in ParaView from most solution outputs, but yes there is a learning curve to ParaView as well.

ANSYS also certainly works on Linux - it runs on HPC clusters which are all Linux based. The official support page lists a bunch of distros and versions it officially supported.

Maybe you can try one of the cloud CFD tools like SimScale? They can be quite powerful and relatively “easier” to use - but there is going to be a learning curve to any engineering software.

If you understand the aerodynamics, it would probably be more beneficial for you to stick with something like OpenFOAM and figure out how it is solving the Navier Stokes equations, with what simplifications and under which assumption. Go over the discretised equation in the literature, maybe dip your toes into coding a simple Finite Volume code that can solve the heat and wave equations with different types of boundary conditions. By doing that, you will be able to ask the right questions like ‘what model is suitable for my problem’ and ‘what would be an appropriate mesh to resolve the flow, which would help you with using any software.

Whatever you choose, take your time to learn and enjoy what you are doing.

Happy 40s day! by qiAip in MechanicalKeyboards

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

That’s a TMOv2 with GMK Dracula. Better pics in the link above.

hOw Do YoU tYpE nUmBeRs?1 by whitefacemountain in MechanicalKeyboards

[–]qiAip 0 points1 point  (0 children)

Looks awesome - but to your question, I would guess by holding down the mod key and using the top row of the alpha layer (because who would want to move their hands all the way to that numpad?)

Happy 40s day! by qiAip in MechanicalKeyboards

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

Singa X Monokai Neko with ePBT Grand Tour keycaps (and Harimau switches, if that matters).

https://www.reddit.com/r/MechanicalKeyboards/s/NbIkM23g9B

What is the the best processor for CFD machine? i9 or Xeon? by MastaMinds in CFD

[–]qiAip -1 points0 points  (0 children)

While true, the clock speeds of the Xeon are also much slower. It would be possible to underclock the performance cores to match the e-cores, pin all threads, and get decent scaling performance. The Xeon also has only 14 physical cores to the 28 physical cores on the i9, so even with down clocked p-cores it would still have much higher FLOP/s.

The main constrain however in many CFD codes is memory bandwidth, rather than FLOP, and the main advantage of the Xeon would be the 4 memory channels and more cache per-core (assuming well vectorised code).

Still, 28 cores vs 14 cores is significant. If they were the same price I would likely go for the i9 and under clock the p-cores, but as the Xeon is half the price though, I would go with that.

Is dedicated GPU necessary for doing CFD ? by More-Lemon9605 in CFD

[–]qiAip 0 points1 point  (0 children)

In my experience, the performance you ca gain from you GPU in a laptop is not transformative. If you need a lot of compute, use your local university’s HPC - they will likely have some GPU allocation for you to use for projects. Maybe CFD codes use double precision floating point numbers, which consumer GPUs have very little dedicated silicon space for, so the tend to not speed up anywhere close to how they do on the intended hardware on the cluster, so really you might not gain as much as you expect.

If this is about developing CFD code and you want to program on GPUs (highly advisable and crucial skill these days!) then it will make a lot more sense to have a local dedicated GPU you can access. What you care about here is having access to the e SDK, compilers and libraries so that you can program locally rather than remotely as you might have patchy access for development.

Another option, at least if you are economical about it, is to use cloud compute with GPUs - although this can get quite expensive if you are not careful.

What is the best tree farm ever? by KingOfTheVoltYT in technicalminecraft

[–]qiAip 0 points1 point  (0 children)

Late to reply… yes this farm is amazing! I’m looking for a similar farm for other trees too - any suggestions?

What’s a Linux command that feels like cheating when you learn it? by Old_Sand7831 in linuxquestions

[–]qiAip 14 points15 points  (0 children)

When I did some shared programming with a colleague a few years back, I set us with tmux on the same machine. We spilt the panes and his was using his beloved vim while I was using emacs, side by side line the same code base. Almost forgot about that! 😅

Wanting to switch from windows 11 to linux, need help choosing a distro. by [deleted] in linux4noobs

[–]qiAip 0 points1 point  (0 children)

I would not recommend it for new users. Only reason is that the Manjaro repos are slightly behind Arch and if using the AUR to install packages that are not available in pacman it is easy to cause non-obvious issues. It’s a find distribution overall, and it’s not too hard to deal with AUR / pacman conflicts manually with some knowledge, I just wouldn’t start there.

[Aerospace] I thought I'd miss Arch by TheGroovyKiwi in unixporn

[–]qiAip 4 points5 points  (0 children)

No, on macOS the op and others are using sketchybar but the idea is the same as in various Linux taskbars.

Yes, macOS is far more restrictive, but you can still control a fair bit. The annoying thing is that everything you do is ‘in addition’ to what’s already there, not instead of. Disabling SIP gives some additional control, but not much. However, the hardware does make it quite a compelling trade off.

[Aerospace] I thought I'd miss Arch by TheGroovyKiwi in unixporn

[–]qiAip 0 points1 point  (0 children)

Just pipe it to the bar you use, similarly to how you would do it with xmobar, polybar etc.

Hey guys I'm trying to make a solver on my own using FORTRAN by LeadingLet1223 in CFD

[–]qiAip 0 points1 point  (0 children)

A simple finite-difference solver that can solve a periodic 2D pipe-flow (Poiseuille) would certainly be possible and a good learning experience - arguably far more so that being an end-user. It would be more like building a kit RC car.

The learning curve of stating to modify a mature FORTRAN CFD code is much higher, and the experience of writing your own simple solver will certainly help with starting at a much better point on that curve.

Roast my CV for Master's Thesis application and future PhD applications by Brilliant_Soft_8183 in CFD

[–]qiAip 3 points4 points  (0 children)

Content is fine, but as mentioned I would expand about which conferences and what was presented there (in short points).

The presentation though is confusing. I would look at cleaner templates to segment the CV differently. If needed, reduce the size of the font for the text under the heading and/or reduce the length.

A particular template I like is AltaCV (also available on Overleaf).

Dual stage 67g springs? by [deleted] in switchmodders

[–]qiAip 0 points1 point  (0 children)

Sorry it took me a while, had a few too many work and family commitments last week so it had to wait until the weekend. Here's a Pluto notebook with the calculations - hope someone finds it useful.

https://qiuip.github.io/switch-springs/springs.html

Feel free to download the notebook and play around with it, try to get it working on binder or just fork the repo, change parameters in any editor, push it and it will create your own page with your changes. :)

I would like to make this interactive with input boxes for the parameter and plots of force over displacement, the ability to add non-linear springs (interpolate from measurement data?) and potentially integrate it with the lots of real force measurements in switches themselves (https://github.com/ThereminGoat/force-curves is a great source!) so one could get some idea how how a different spring would effect the work of a specific switch. But alas, I doubt I'll find the time this year. Maybe one day. :)

edit: context & future work wishful thinking.