OpenCl multiple GPUs, memory and tuning

Thank you for your response.
I should like to test the effect of asynchronous mode.
I have the following settings:
SkƦrmbillede (1438)

Do I need anything else to activate asynchronous mode.

your snippet shows the priority settings for gpu usage for different pipes.
darktable 4.6 user manual - memory & performance tuning section
darktable 4.6 user manual - memory & performance tuning
describes how to control each gpu

I have read followed the link in your post and have reread the documentation.

The documentation doesnā€™t explain how you, based on the debug output, can tell whether the center image view and the preview window are being run in parallel or sequentially. That is my basic question.

but it tells how to activate/deactivate the asynchronous mode. that was your last question :wink:

Thatā€™s what you need ā€˜-d pipeā€™ for. You get info about the pipes and what device is used.

But I donā€™t understand what you are really after.

1 Like

Thank you for your answer.
Iā€™m trying to optimize darktable on my not too powerful pc. The OpenCL section of the documentation describes several tuning possibilities among these are the possibility to have the full and preview pixelpipes running in parallel. Therefore, I would like to see this in action.
But when I open my demo image in darkroom and he settings are


then full view is processed on GPU 0 and preview on GPU 1 and there is no sign that this is happening in parallel
If the settings are

then full view and preview are both processed on GPU 0

Why is the full view and preview not processed in parallel in any of the above cases?

How are you making this determination??

EDIT:

You might also really just be seeing this sort of thingā€¦ I am no expert on integrated GPU. Personally if I had a system with only GB of Ram but I had a dedicated GPU if would likely go strait to the bios and disable the integrated GPUā€¦ I think the system would make much better use of it overall in all softwareā€¦ But this is just meā€¦ The thing is that the vram for integrated graphics is virtualā€¦ taken from system ram up to what you allow it to as a maximumā€¦ The OS manages this and so there is not guarantee it gets usedā€¦if the system is short on memory I think there is some OS control on this shared memory to allow for the best performanceā€¦

I came across this comment in an explanation of integrated graphics memory useā€¦

ā€œIf you have a dedicated GPU, leaving things as they are would probably be for the best. Depending on your particular graphics card and its VRAM capacity, shared GPU memory might not even be used at all!ā€

So there could be memory management going on at the OS level in your case ā€¦

Without testing its all speculation

EDIT 2

Also if you are going to leave both enabled you might want to see how your OS settings are configuredā€¦ It was noted that for example with ON1 PhotoRaw if you did not tweak these settings in the OS then even though you told ON1 to use your GPU it might notā€¦ Just to be sure I did this for any program that I want to be sure is using a dedicated GPU on my systemā€¦ I am at work on my old desktop this is what it looks likeā€¦ ignore if you have already explored thisā€¦

image

You are assuming that the request from dt processing starts at the same time. The pipe will request processing as needed.

If you want to optimize, I suggest looking at -d perf and see if there is a module that is taking too long.

You have a much more powerful Nvidia card than Intel 4400, you have just 8gb of ram that is shared with opencl graphics.

I have done almost all of the dt opencl stuff over the last years and I know quite well how dt uses itā€™s resources. You may play around with settings, but just do this as a sound advice

  1. Disable Intel opencl graphics
  2. Use fast graphics card for scheduler
  3. Use large as resources
  4. Donā€™t tune Any special settings
  5. Donā€™t use asynchronous setting
4 Likes

I will follow your adviceā€¦ā€¦:blush:

I can disable Intel OpenCL graphics by the opencl_device_priority settings or I can disable Intel graphics in device manager. Which method should I prefer?

What do you mean by ā€œuse fast graphics card for schedulerā€

basically DT will use your dedicated gpu for everything when you set it to very fast

I would disable it in the bios or whatever your system offers.

1 Like

Some responses to your posts:

The debug information generated by -d perf ā€“d opencl shows which GPU is used

I have the same graphics setting on my pc as you show in your post but for some reason NVIDIA is only used when running darktable if OpenCL is turned on (I can tell this by the performance tab in task manager). Maybe Iā€™m missing some other settingā€¦ā€¦

I have noticed that Intel graphics is used by the darktable app only if NVIDIA is excluded by ā€œ!ā€ in opencl_device_priority. In all other cases NVIDIA is used by darktable regardless of the OpenCL scheduling profilesetting (default, very fast GPU or multiple GPUs)

So I need no special setting to ā€œuse fast graphics card for schedulerā€?

Do this in the biosā€¦ if you do it in the OS maybe it will create issuesā€¦ So just follow the steps aboveā€¦ Disable integrated graphics in the biosā€¦no changes to priorities or OSā€¦

Now you will boot with only one GPU.

I would delete all the opencl kernels in the Appdata/ā€¦/ā€¦/inet folder and let DT rebuild a new one for these conditionsā€¦then set the rest as @hannoschwalm indicatesā€¦ very fast will impose the best scheduling in most casesā€¦

This should be your optimum setup for DT and indeed Windows and your other software

That is to be expected, as OpenCL is a standard that allows using graphic cards for computations without writing different code for different cards. So no OpenCL = no GPU usage.

If the only ā€˜problemā€™ with the Intel card is that OpenCL in darktable is slow, disable it using the apropriate darktablerc option (check de manual, there is one parameter for each card that defines if it is available or not, even before the device_priority setting). Disabling it at the BIOS or OS level will leave you with a single available card for everything (not only OpenCL), at thatā€™s probably not what you want (there is a good reason notebooks come with that hybrid two-card setup).

Its mostly to save powerā€¦

And, specially on Windows, the difference can be substantial. Also, while the NVidia card is busy doing work on darktable, the Intel can be dedicated to other mundane tasks as drawing the rest of the screen (itā€™s actually possible to configure it in such a way that the NVidia is used only in darktable and other graphic-intensive tasks). And, finally, some notebooks have monitor outputs directly wired to certain cards, and disabling them can disable those ports. So, usually ā€˜disabling it at the BIOS or OS levelā€™ can have unintended consequences, and probably is not worth it when there is a specific option to disable it only on darktable (eighth parameter at darktable 4.6 user manual - memory & performance tuning)

Ya I agree but the direct port is likely going to be to the dedicated GPU so I donā€™t think any harm thereā€¦ In the end it will depend on the mix of the software used and what it works best withā€¦ still I think on a 8GB machine most tests will show a little bottle neck in a performance app, ie a game or video and maybe graphic editors overall and even on the dedicated GPU. If the box is mostly plugged in I would disable it and set everything to high performance but if it gets used for a lot of basic work doing a mix of tasks and unplugged and mobile then there might be some benefit esp for battery to leaving it available. In the end watching a task monitor during use and trying both configurations should reveal if there is any benefit or penalty for one over the otherā€¦

1 Like