Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wierdly behaving 3D objects / Meshes #184

Open
MGRAFF2006 opened this issue May 23, 2024 · 17 comments
Open

Wierdly behaving 3D objects / Meshes #184

MGRAFF2006 opened this issue May 23, 2024 · 17 comments
Labels
compiler/driver/OS issue Issues with the C++ compiler, the OpenCL driver of the device vendor, or the operating system

Comments

@MGRAFF2006
Copy link

I am pretty much a noob at fluid dynamics, but need to do some quick calculations on the characteristics of some boats for digital prototyping.

After some poking around I started to get a hang of FluidX3D and decided instead of just changing values, reading the docs and understanding the setup.cpp i would try to create my version of one of the scenarios.

In this case i took the f1 car simulation and tried to get one of our Dummy Models in. Which didn't really ended up working:
image

Here is a picture of the original 3D Model in Autodesk Fusion:
image

I know it is probably not recommended having models with multiple non connected parts, but this is the version i have at the moment, also tried other variants (different models in different simulations to try to debug it myself) which I unfortunately don't have anymore.

But a resume of my tests could be, that many of the models i tested were having weird shapes like that, and some would change their shapes while the simulation is running even though i set them as Solid.

Really don't know what is wrong / what i should try anymore. Thanks for any Help / Hint in advance

Here you can find the .stl file and my setup.cpp:
issue.zip

@gitcnd
Copy link

gitcnd commented May 24, 2024

Loads OK for me - you probably need a larger simulation? Try 14000u instead of 4000u

pic_2024-05-24_23 10 30_597

I ran it like this from WSL:-

/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe start "cmd.exe '/c mode con: lines=80 & bin\FluidX3D.exe -f ..\..\cat.stl -r 16000 --SUBGRID --rotz 90 --rotx 180 --roty 180 --try -0.9 -y 1 -z 0.5 -x 0.3 -c 0.15 --aoa 0.0 --slomo 200.0 --fps 60 --SRT --UPDATE_FIELDS --GRAPHICS --EQUILIBRIUM_BOUNDARIES --FP16S --D3Q15 & pause'"

using my branch from here: https://github.com/gitcnd/FluidX3D/tree/inline_things

What are the "some quick calculations on the characteristics" you're trying to work out?

For context - I'm the author of the free Fusion360 "Airfoil Tools" add-in - which might also be able to help.

@ProjectPhysX
Copy link
Owner

ProjectPhysX commented May 24, 2024

Hi @MGRAFF2006,

I'm sorry that the first thing you see is something not working. Let's get to the bottom of it. Thanks for already providing the reproducer! I need some more information: What hardware are you running this on? Maybe it is an issue with the particular drivers.

Running this exact reproducer on my system (tested on 3 OpenCL devices: Arc A750, UHD 630 and i7-8700K), the setup looks fine and I can't observe the artifacting. The mesh looks also fine.
grafik

To place the model in the center, use this:

	Mesh* cat = read_stl(get_exe_path()+"../stl/cat.stl");
	cat->rotate(float3x3(float3(0, 0, 1), radians(-90.0f))); // rotate -90 degrees around z-axis
	const float scale = 0.8f*fmin(fmin(lbm_N.x/cat->get_bounding_box_size().x, lbm_N.y/cat->get_bounding_box_size().y), lbm_N.z/cat->get_bounding_box_size().z); // scale parts
	cat->scale(scale);
	const float3 offset = lbm.center()-cat->get_bounding_box_center();
	cat->translate(offset);
	cat->set_center(cat->get_bounding_box_center()); // set center of meshes to their bounding box center
	lbm.voxelize_mesh_on_device(cat);

grafik

Kind regards,
Moritz

@ProjectPhysX
Copy link
Owner

Hi @MGRAFF2006,

is this issue resolved for you?

Kind regards,
Moritz

@ikozyris
Copy link

ikozyris commented Aug 3, 2024

I have the same problem on an Intel Iris Xe iGPU. The examples worked, so I tried a custom STL file, which had similar issues. Then found this issue and can reproduce the exact same weird rendering. There are no problems when run on CPU.
I suspect either a driver issue or the iGPU doesn't have enough memory.

@ProjectPhysX
Copy link
Owner

@MGRAFF2006 @ikozyris which exact iGPU from which CPU, and what driver version is it? Does it still show the artifacts with the latest Intel iGPU driver?

@ProjectPhysX ProjectPhysX added the compiler/driver/OS issue Issues with the C++ compiler, the OpenCL driver of the device vendor, or the operating system label Aug 4, 2024
@ikozyris
Copy link

ikozyris commented Aug 4, 2024

This is the output of lspci on Linux 6.8.0-1009-oem Ubuntu 24.04 and i7-1370P:

0000:00:02.0 VGA compatible controller: Intel Corporation Raptor Lake-P [Iris Xe Graphics] (rev 04)
	Subsystem: Dell Raptor Lake-P [Iris Xe Graphics]
	Kernel driver in use: i915
	Kernel modules: i915, xe

And glxinfo:

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel (0x8086)
    Device: Mesa Intel(R) Graphics (RPL-P) (0xa7a0)
    Version: 24.0.9
    Accelerated: yes
    Video memory: 31704MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) Graphics (RPL-P)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 24.0.9-0ubuntu0.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.0.9-0ubuntu0.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 24.0.9-0ubuntu0.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

intel-opencl-icd is version 23.43.27642.40-1ubuntu3
In its package description it mentions support for up to Alder Lake (12th gen), while I'm on Raptor Lake (13). I installed the latest drivers from intel repositories. Now the package is 24.22.29735.27-914~22.04 and the isssue persists (the noble package is for jammy?).

@lk251
Copy link

lk251 commented Aug 30, 2024

I am having similar issues voxelizing the Airshaper Formula 1 stl file
image

https://app.airshaper.com/simulations/aero-update-4-new-7ae386

@lk251
Copy link

lk251 commented Aug 30, 2024

image

image

@MGRAFF2006
Copy link
Author

MGRAFF2006 commented Aug 30, 2024

@ProjectPhysX
Sorry for answaring this Late,
I was using an AMD 5600G With uptodate Drivers, I suppose it so a GPU Memory Issue, and on really small Memory, it Spams Like there is some buffer overflow or runaway Memory, behause out of regular positions there are Kind of Bars that extend out of them.

I came to this Idee, because it Spams Like that with at least one Intel and one AMD issue Driver Fallrückzieher Spams pretty unlikely in my eyes

The 5600G also has only about 500MB dedicated GPU memory

@ikozyris
Copy link

ikozyris commented Aug 30, 2024

On my device, loading STLs works on windows with GPU, but on linux only with CPU (other simulations on linux are fine with GPU). So I suppose an issue with the opencl-icd package.
I have very small GPU memory too (256MB), but since the GPU can use normal memory as well (32GB) it shouldn't be a problem.

@MGRAFF2006
Copy link
Author

@ikozyris, i also have Shared Memory enabled, that means it can use up to 7gb of ram on my System, but i think what could be Happening in this casi is that it can‘t keep up in terms of Speed. It is the Same with swap, you can have a rediculous amount of it, but at some Point it is Not going to be used more, because it is Not feasable for the is anymore.

@ikozyris
Copy link

@MGRAFF2006 Have you tested if it works on windows? If there isn't enough memory it shouldn't work there too, but it did work for me.
About swap, it may be slow but it still works

@ProjectPhysX
Copy link
Owner

@lk251 what you posted is a different issue. This happens when the mesh is not watertight, meaning there is holes or overlapping triangles. There is software to fix such meshes, like 3D Builder. What also can help is reducing triangle count.
See #59 and #215.

@ProjectPhysX
Copy link
Owner

@MGRAFF2006 the iGPU has no dedicated memory, it just uses shared RAM. The RAM speed is not the issue - if it's slow than it will just take longer, but must still be the same computation result. It looks more like a driver bug to me. But it's strange that it happens on both Intel Raptor Lake iGPU and Ryzen iGPU.
Do you have the latest version of FluidX3D? There was a related bug fix in voxization back in April. And does the bug happen only with a particular stl mesh or with all other meshes?

@lk251
Copy link

lk251 commented Aug 31, 2024

@ProjectPhysX thank you! I will try to fix the mesh and remove the tyres so I can make them rotate as in the W14 example. This is a much more realistic model of the current regulations f1 car so the results will be interesting.

@lk251
Copy link

lk251 commented Sep 2, 2024

@ProjectPhysX I was able to obtain the Blender file for the Airshaper car, if you know anyone interested in collaborating, please get them in touch so we can fix the model (make it watertight). Thank you!

@lk251
Copy link

lk251 commented Oct 8, 2024

We got the Airshaper model to work, I'm preparing a much larger simulation now. Again if anyone is interested in getting this to work please let me know.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/driver/OS issue Issues with the C++ compiler, the OpenCL driver of the device vendor, or the operating system
Projects
None yet
Development

No branches or pull requests

5 participants