Fluidx3d code -- graphics related compile problem

fluidx3d is a relatively new lattis boltzmann fluid dynamics solver. I downloaded code from the website: see below. It is reported to be blazingly fast compared to others solving NS eqns. The breakthrough is in improved cutstomized cpu and gpu memory logic using openCL on a microscopic scale.

The code gets recompiled for each run. The first run is speed “benchmarks” which I completed but that was in text mode. The next run is to run a sample problem with x11 graphics display.

https://fluidx3d.com

Compiling for the test run gives error related to graphics. See below:

tom@mydesktop: ~/Cfd/FluidX3D $ ./make.sh 
Info: Detected Operating System: Linux-X11
Info: Compiling with 12 CPU cores.
g++ -c src/graphics.cpp -o temp/graphics.o -std=c++17 -pthread -O -Wno-comment -I./src/X11/include
g++ -c src/info.cpp -o temp/info.o -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include
g++ -c src/kernel.cpp -o temp/kernel.o -std=c++17 -pthread -O -Wno-comment
g++ -c src/lbm.cpp -o temp/lbm.o -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include
g++ -c src/lodepng.cpp -o temp/lodepng.o -std=c++17 -pthread -O -Wno-comment
g++ -c src/main.cpp -o temp/main.o -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include
g++ -c src/setup.cpp -o temp/setup.o -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include
g++ -c src/shapes.cpp -o temp/shapes.o -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include
g++ temp/*.o -o bin/FluidX3D -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include -L./src/OpenCL/lib -lOpenCL -I./src/X11/include -L./src/X11/lib -lX11 -lXrandr
X Error of failed request:  BadRRCrtc (invalid Crtc parameter)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  20 (RRGetCrtcInfo)
  Crtc id in failed request: 0x0
  Serial number of failed request:  14
  Current serial number in output stream:  14

xrandr shows:

tom@mydesktop: ~/Cfd/FluidX3D $ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DVI-D-0 disconnected primary (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+  59.94    50.00    60.05    60.00    50.04  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
tom@mydesktop: ~/Cfd/FluidX3D $

Anyone gotten fluidx3d running? Anyone have idea of how to solve graphics issue? I think some xrandr load options might be the key.

thanks all, tom kosvic

1 Like

@tckosvic make Linux compiles fine (on intel ARC)… runs fine on wayland (RTX4000)…

./FluidX3D 
.-----------------------------------------------------------------------------.
|                       ______________   ______________                       |
|                       \   ________  | |  ________   /                       |
|                        \  \       | | | |       /  /                        |
|                         \  \      | | | |      /  /                         |
|                          \  \     | | | |     /  /                          |
|                           \  \_.-"  | |  "-._/  /                           |
|                            \    _.-" _ "-._    /                            |
|                             \.-" _.-" "-._ "-./                             |
|                               .-"  .-"-.  "-.                               |
|                               \  v"     "v  /                               |
|                                \  \     /  /                                |
|                                 \  \   /  /                                 |
|                                  \  \ /  /                                  |
|                                   \  '  /                                   |
|                                    \   /                                    |
|                                     \ /                FluidX3D Version 3.7 |
|                                      '     Copyright (c) Dr. Moritz Lehmann |
|-----------------------------------------------------------------------------|
|----------------.------------------------------------------------------------|
| Device ID    0 | Quadro RTX 4000                                            |
|----------------'------------------------------------------------------------|
|----------------.------------------------------------------------------------|
| Device ID      | 0                                                          |
| Device Name    | Quadro RTX 4000                                            |
| Device Vendor  | NVIDIA Corporation                                         |
| Device Driver  | 610.57.04 (Linux)                                          |
| OpenCL Version | OpenCL C 3.0                                               |
| Compute Units  | 36 at 1545 MHz (2304 cores, 7.119 TFLOPs/s)                |
| Memory, Cache  | 7794 MB VRAM, 1152 KB global / 48 KB local                 |
| Buffer Limits  | 1948 MB global, 64 KB constant                             |
|----------------'------------------------------------------------------------|
| Info: OpenCL C code successfully compiled.                                  |
| Info: Allocating memory. This may take a few seconds.                       |
|-----------------.-----------------------------------------------------------|
| Grid Resolution |                                256 x 256 x 256 = 16777216 |
| Grid Domains    |                                             1 x 1 x 1 = 1 |
| LBM Type        |                                    D3Q19 SRT (FP32/FP16S) |
| Memory Usage    |                                 CPU 272 MB, GPU 1x 880 MB |
| Max Alloc Size  |                                                    608 MB |
| Time Steps      |                                                     10000 |
| Kin. Viscosity  |                                                1.00000000 |
| Relaxation Time |                                                3.50000000 |
| Reynolds Number |                                                  Re < 256 |
|---------.-------'-----.-----------.-------------------.---------------------|
| MLUPs   | Bandwidth   | Steps/s   | Current Step      | Time Remaining      |
|    4802 |    370 GB/s |       286 |         9997 100% |                  0s |
|---------'-------------'-----------'-------------------'---------------------|
| Info: Peak MLUPs/s = 4808                                                   |

I don’t see the error, built as Linux and Linux-X11 and they compiled fine and ran the benchmark on both Nvidia and Intel ARC (way slower… that’s because I have no rebar and PCIe 3.0).

What GPU in use?

I ran the benchmark as you did. That is a text process. You beat me by a mile. My 7 y/o thing only got 1200.

To run a real graphical cfd problem, you need to edit files in /src directory. Edit defines.hpp to disable Benchmark and enable Interactive Graphics by commenting out first and uncommenting in the second. Then you then edit setup.cpp to enable one problem code sequence. Then run make.sh again to run problem.

That is where the problem occurred. Docs are in the git and kind of cryptical. If you do that let me know if you see same thing.

thanks, tom kosvic

Sorry, I forgot one more thing. edit make.sh to enable “target=Linux-X11 # manually set to compile on Linux with X11 graphics”.

Just found a really comprehensive AI problem solver that seems to thoroughly understand fluidx3d intricately.

It says I need xrandr-devel code but libxrandr-devel is already installed. It also gives code modif suggestions to get past problem.

Link Removed

Please, please, please Can we keep this a place where humans interact with each other instead of throwing YaAIR ( Yet another AI Result )at one another?

The deep AI found my problem – graphics now starts. Solution is below. Code needed display labeled as primary which apparently I did not have.

xrandr --output HDMI-0 --primary

Before change:

tom@mydesktop: ~/Cfd/FluidX3D/src $ xrandr --query
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DVI-D-0 disconnected primary (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+  59.94    50.00    60.05    60.00    50.04  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)

After change.

tom@mydesktop: ~/Cfd/FluidX3D $ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+  59.94    50.00    60.05    60.00    50.04  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
tom@mydesktop: ~/Cfd/FluidX3D $

whoops, looks like the xrander setting that fixed my problem goes away upon reboot. I had to re-enter it. Anyone know how to make it permanent.

If above question is another thread, I apologize. Let me know.

found solution on

(https://unix.stackexchange.com/questions/125556/how-can-i-make-xrandr-changes-persist)
I created the following file:

/etc/X11/Xsession.d/45custom_xrandr-settings and placed this line into it:

xrandr --output DFP6 --primary

This had the effect of making the correct monitor the primary one, and it launches on login.


I will model this for a try.

tom kosvic

Creating that file did not work. Got xrandr error after reboot. For now, need to run xrandr string each time before I run ./make.sh

@tckosvic et al. Please ensure you read and understand the Fourm FAQ’s for AI Content before posting, thanks.

2 Likes

I only brought up the reference that was removed because it solved the problem and I verified that it did. i thought we were to post solutions to whatever problem someone is encountering and has posted. Now there is a solution to the graphics issue with no reference to where it came from. I thought documentation of info was an important part of this forum.

tom kosvic

@tckosvic A solution in your own words, if you read the AI Content policy in the FAQ’s it may be clearer as to what is expected?