Windows dev compiling

I am or ChatGPT is… :blush:

Only the poor craftsman blames to tool
:face_with_spiral_eyes:

It was funny I just put @stuntflyer ‘s exact question …ie can you explain…. Just as a lark to see what it would spit out….

1 Like

These flags are to optimize the build for your specific processor. There are quite few options and I am only showing here the basic ones.

For instance in my case I have options for optimizing the use of my Ryzen processor series.

Obviously if you build with these options, you can only run the code on the same type of processor.

@dtrtuser So, this code optimizes for anyone’s processor or just the Ryzen

this is without Ryzen specific optimization. This should work on all processors.

1 Like

@dtrtuser Is there one that is specific to the i7-8700 (coffee lake)?

See here for list of CPU choices for the -march option: x86 Options (Using the GNU Compiler Collection (GCC))

I can’t find something specific to Coffe Lake but you might want to try this:

CFLAGS="-O3 -march=skylake"

as suggested here: Gentoo Forums :: View topic - CFLAGS for a very new i7 CoffeeLake

Having said that, I wouldn’t worry too much about CPU optimization but rather focus on OpenCL configuration as most of DT operations are using your GPU.

1 Like

@dtrtuser The script works perfectly. If possible what would the syntax be with the included skylake option?

Just replace the original cmake command with this one…

cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/darktable -DCUSTOM_CFLAGS=ON -DCMAKE_CXX_FLAGS="-O3 -march=skylake" -DCMAKE_C_FLAGS="-O3 -march=skylake" -DBINARY_PACKAGE_BUILD=OFF ../.

@dtrtuser Thanks!

Try -march=native instead of -march=skylake.

-march=cpu-type

    Generate instructions for the machine type cpu-type. In contrast to
    -mtune=cpu-type, which  merely tunes the generated code for the
    specified cpu-type, -march=cpu-type allows GCC to generate code
    that may not run at all on processors other than the one indicated.
    Specifying -march=cpu-type implies -mtune=cpu-type, except
    where noted otherwise.

    The choices for cpu-type are:

    ‘native’

        This selects the CPU to generate code for at compilation time by
        determining the processor type of the compiling machine. Using
        -march=native enables all instruction subsets supported by the
        local machine (hence the result might not run on different machines).
        Using -mtune=native produces code optimized for the local machine
        under the constraints of the selected instruction set.
1 Like

I will try that. Thanks @kofa . That works, though I don’t see a performance difference for startup. Where might I notice something?

After a clean boot of win 10, . .
DT loads twice as fast the second time I open the program. From 8 sec down to 4 sec.

With computationally heavy modules, like diffuse or sharpen. But to be honest, don’t expect a huge difference. A GPU with OpenCL will be much faster.

1 Like

As @kofa says the GPU dominates so gains might be marginal esp just trying to go by a sense of if its seems faster or timing it…but turning off opencl in an optimized vs non optimized copy of DT and running a few edits and checking the logs will let you pick up any potential gains that you got from the build if you ever did bump to the cpu while running DT…

That may be purely due to a disk cache: second time you start dt, the relevant files are already available in memory, so there’s no disk read involved (in my case, program + databases take up about 1GB, on a machine with 48 GB, of which 10 GB in use…).

In any case, I’m not at all convinced start-up time is the best measure in this case, as the CPU use will be quite different compared to image treatment.

@rvietor I totally agree that start up times are not the best measure. What I have noticed is that now zooming in and out is quick and smooth as compared to using the less optimized dev versions. Diffuse or sharpen runs well.

This leaves me to believe that 6GB of GPU memory is more than enough. I have to wonder though if performance from a more up to date CPU would be all that more noticeable, since most of the work is handled by the GPU.

Measurable, probably yes. Noticeable, probably not. See above – the with OpenCL line.

1 Like