STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Post by vejmarie »

sgrogan wrote:
easyw-fc wrote: I use this code to test fps in a reproducible mode:
1.5 fps vs 1.8 fps
Hi what is your gpu ? The big step requires 2G of gpu ram
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Post by vejmarie »

easyw-fc wrote:
wmayer wrote:PR 517 is merged now.

Open points
  • in the past when loading step files a progress bar was shown. At the moment this doesn't work any more
  • when setting a colour per face then it doesn't work when VBO is on
    ....
I can confirm that in win10-64b FC 10084-64b I have
1) when setting a color per face then it doesn't work when VBO is on
2) when setting a color per all Shape then it doesn't work when VBO is on
3) color will be displayed correctly just changing VBO preferences (so it seems they get assigned correctly, but not displayed w VBO)
vejmarie wrote:Your timing i still very disturbing to me. My system is a Macbook Pro Core i5 2.7Ghz .. Not the fastest stuff (this is a laptop), and I am reading this file in 360s everything included with latest build compares to 340s with CAD Assitant on the same machine
new testing results are:
w/out VBO
loading...
Cannot compute Inventor representation for the shape of Part__Feature148.
.....
Cannot compute Inventor representation for the shape of Part__Feature890.
loading time = 925.803999901s
displaying time = 474.888999939s

w/out VBO
875ms/1.1fps
w VBO
170ms/6.2fps
loading time with VBO enabled doesn't change the loading time sensibly
fps is improved a lot! :D

Still I have a lot of errors "Cannot compute Inventor representation for the shape" and loading and displaying time quite high compared to yours
Please let me know if I can do more test to help in find to solve this riddle on slower performance compared to osx...
It would be nice to have a comparison on Linux and Windows pcs with similar hw

Maurice
Color is not yet fully implemented this is why you see these errors I will try to make it during the week :)
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Post by easyw-fc »

vejmarie wrote: Color is not yet fully implemented this is why you see these errors I will try to make it during the week :)
Great! looking forward :D
Thx
M
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Post by vejmarie »

@wwmayer, I have revert back the ProgressBar code and still have the same issue. The ProgressBar is updated there

Code: Select all

void Sequencer::setValue(int step)
{
    QThread *currentThread = QThread::currentThread();
    QThread *thr = d->bar->thread(); // this is the main thread
    if ( thr == currentThread )
    // if number of total steps is unknown then increment only by one
    if (nTotalSteps == 0) {
        int elapsed = d->progressTime.elapsed();
        // allow an update every 500 milliseconds only
        if (elapsed > 500) {
            d->progressTime.restart();
            if (thr != currentThread) {
                QMetaObject::invokeMethod(d->bar, "setValue", Qt::/*Blocking*/QueuedConnection,
                    QGenericReturnArgument(), Q_ARG(int,d->bar->value()+1));
            }
            else {
                d->bar->setValue(d->bar->value()+1);
                qApp->processEvents();
            }
        }
    }
    else {
        if (thr != currentThread) {
            QMetaObject::invokeMethod(d->bar, "setValue", Qt::/*Blocking*/QueuedConnection,
                QGenericReturnArgument(), Q_ARG(int,step));
            if (d->bar->isVisible())
                showRemainingTime();
        }
        else {
            d->bar->setValue(step);
          if (d->bar->isVisible())
                showRemainingTime();
            d->bar->resetObserveEventFilter();
            qApp->processEvents();
        }
    }
But the Main GUI thread is stuck during the Step reading operation (aka it never enter the code) up to the time the aReader get out (and my bar is displayed at 100%). So the InvokeMethod is called but the bar value is never updated during the step reading. So we are properly receiving the value within the call (there is an issue on macOS where size_t is not properly defined, and OCCT is sending float not int and the casting was totally a mess that is why I was always getting 0. I am now moving between 0 to 100 with 1 or 2 increments which is good). Do you have any idea ? Where does the Gui thread is supposed to stand during the Step reading operation, is it supposed to be the same thread than the one reading ? (One of my option is that OCCT create thread to make the operation and when the call happens QT doesn't recognize the code to be executed by a child thread, but this is pure supposition)
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Post by triplus »

Note that if we use functionality related to OCC/OCE progress indicator. That functionality is currently not thread-safe.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Post by sgrogan »

vejmarie wrote:Hi what is your gpu ? The big step requires 2G of gpu ram
Ram isn't a problem.
NVIDIA Quadro 4100M @ 1920 x 1080
I just tested this on Trusty (dual boot with the same hardware) 1.8 > 22 fps! :D
I need to check Win system settings and the driver versions. On Win I have the latest driver per the manufacturer (Not Win Update) I think I'm using the open source drivers on linux (not sure)
UPDATE: Problem on win was at least partially PEBCAK, some how I was using on board graphics, and indeed gpu ram < 2GB
After fixing this, 1.5 > 8.4 fps, still need to find the rest of the improvement.
"fight the good fight"
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Post by vejmarie »

sgrogan wrote:
vejmarie wrote:Hi what is your gpu ? The big step requires 2G of gpu ram
Ram isn't a problem.
NVIDIA Quadro 4100M @ 1920 x 1080
I just tested this on Trusty (dual boot with the same hardware) 1.8 > 22 fps! :D
I need to check Win system settings and the driver versions. On Win I have the latest driver per the manufacturer (Not Win Update) I think I'm using the open source drivers on linux (not sure)
UPDATE: Problem on win was at least partially PEBCAK, some how I was using on board graphics, and indeed gpu ram < 2GB
After fixing this, 1.5 > 8.4 fps, still need to find the rest of the improvement.
That is some promising results which do correspond to my expectations on such hardware. Regarding your update the ratio you got is the same one than the one I have on my IRIS integrated GPU from Intel. I suspect that your driver is still rendering everything on the IGP instead of the Quadro board.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Post by sgrogan »

vejmarie wrote: That is some promising results which do correspond to my expectations on such hardware. Regarding your update the ratio you got is the same one than the one I have on my IRIS integrated GPU from Intel. I suspect that your driver is still rendering everything on the IGP instead of the Quadro board.
I'm chasing this. I found an interesting parameter in the Nvidia control panel, "OpenGL rendering GPU" it was set to "auto detect" I changed it to point to Nvidia, unfortunately no joy.
"fight the good fight"
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Post by bernd »

bernd wrote:
vejmarie wrote:I got an IFC not supported on my system. Any idea on how to enable it ?
I'm gone provided an step, but it will take a few hours, because ifc importer in FreeCAD is not optimized on speed.
I had (and still have) some trouble with this specific IFC. But I found somthing very much better to treat FreeCAD. I was not aware that I have dozens of files which easily breaks FreeCAD. We do reinforcement drawings at work. I tried to import the reinforcement of a 4 storey building into FreeCAD which takes a few hours but works. While exporting to step I run out of memory (16 GB Ram). If someone is interested in treating FreeCAD I provided a few files on my next cloud https://pro.woelkli.com/s/xdhi7FIkQjyhGLu If I use the reinforcement of just one slab my FreeCAD can handle it. The step is 455 MB See screen.
reinforcement--04--basement_floor_slab.jpg
reinforcement--04--basement_floor_slab.jpg (1022.35 KiB) Viewed 2357 times
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: STEP reader improvement (Pass 4): Moving to OpenGL 3.2

Post by saso »

I can't download the big one :roll:
Post Reply