Page MenuHome

GPU: Platform Support Level
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Tue, Oct 1, 2:52 PM.

Details

Summary

Adds a check when starting blender if your platform is supported. We use a blacklist
as drivers are updated more regular then blender (stable releases).

The mechanism detects if the support level changed or has been validated by the user previously.
Changes can happen due to users updating their drivers, but also when we change the support
level in our code base.

When the user has seen the limited support level message it is saved in the user config.
It would be better to have a system specific config section, but currently not clear
what could benefit from that.

When the platform is unsupported or has limited support a dialog box will appear including a link
to our user manual describing what to do. This part of the manual still needs to be reorganized.

Windows
Windows uses the MessageBox that is provided by the windows kernel.

X11
We use a very lowlevel messagebox for X11. It is very limited in use and can be fine tuned when needed.

SDL/APPLE
There is no implementation for SDL or APPLE at this moment as the platform support feature targets mostly Windows users.

Diff Detail

Repository
rB Blender

Event Timeline

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Tue, Oct 1, 2:56 PM

Added windows specific stuff to GHOST so I can switch back to linux

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)

Added Low level X11 Message Box

Brecht Van Lommel (brecht) requested changes to this revision.Wed, Oct 2, 4:39 PM

I think it's fine to leave out macOS support. The main thing is getting this to work on Windows.

intern/ghost/intern/GHOST_SystemWin32.cpp
314

Define a constant for this rather than hardcoding 1024.

source/blender/windowmanager/intern/wm_platform_support.c
86

Don't show a warning for unknown vendors, we should purely be blacklisting, not whitelisting.

99

If a computer has graphics switching and both cards are unsupported, we will show the warning many times. So I think this should store multiple keys.

For the implementation, BLI_file_read_as_lines could be used. New lines would have to be stripped.

It's may also be simplest if wm_platform_support_load_state and wm_platform_support_save_state get merged into a single function. It can check if the given key is in the file, and if not append it.

172

I think we should deduplicate this code with gpu_extensions_init.

What I suggest is to add gpu_platform.c containing gpu_platform_init() to detect GG.device, GG.driver and GG.os.

GPU_type_matches(), eWM_SupportLevel, WM_PlatformSupportTest would all in that file as well then. gpu_extensions_init() would use GPU_type_matches().

205

__APPLE -> __APPLE__

282

Limitted -> Limited

297

and -> or

298

This seems to say a solution is definitely possible, might want to formulate it a bit different.

314

Why not save in background mode?

This revision now requires changes to proceed.Wed, Oct 2, 4:39 PM
LazyDodo (LazyDodo) added inline comments.
source/blender/windowmanager/intern/wm_platform_support.c
135

this writes a \n that later will be returned in wm_platform_support_load_state causing the strcmp later on to fail and give the popup every time the user starts blender.

288

  1. layout doesn't look great
  1. Your graphics card and driver has limited.

Unsure what we are trying to say here? are limited? have limited capabilities?

  1. There is only an OK button, no Help to press, if we mean a specific help menu item, we should clarify this a little better.
297

is -> are

See P1124 for how to add a help button on windows , not super thrilled about that global for storing the link, but didn't see a neat other way to do it.

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Thu, Oct 3, 1:20 PM
Jeroen Bakker (jbakker) marked 8 inline comments as done.
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • Added help button in windows
  • Removed callback so we can do a more clean exit (basically it crashes and therefore it exited)
  • Deduplicated with GPU package.
  • Many small tweaks from code review
Jeroen Bakker (jbakker) marked 4 inline comments as done.

Removed unneeded \ in gpu_shader.c

@Brecht Van Lommel (brecht) In order to get a clean exit from this code I would check if we could change the callback to a function and show the message box in wm_init. this will also remove some repetitive code.

@LazyDodo (LazyDodo) I see your solution, I have tested many different solutions, but it is not possible without a global. I have cleaned it up a bit.

source/blender/gpu/intern/gpu_shader.c
691

Something happened here. will clean up

source/blender/windowmanager/intern/wm_platform_support.c
135

Gotcha! well we will be refactoring load_state and save_state so this will not be an issue anymore

314

When running in background mode the user might not notice that there is a support issue.
There are also existing addons who during installation run blender to register/enable the addon.

By not doing this during background we know for sure that the message has been seen.

Jeroen Bakker (jbakker) retitled this revision from WIP: Platform Support Level to GPU: Platform Support Level.Thu, Oct 3, 4:29 PM
source/blender/windowmanager/intern/wm_platform_support.h
29

Add comment that this function is implemented in wm_window.c but defined here as it is currently only supported to be called from here.

I did tried other places, but that lead due to the GHOST_DialogOptions that GHOST needed to be included in many areas.

I think we should name the buttons something else than Help and Ok, I expect many of users will just click Ok without reading. At least for me personally, I'm sort of conditioned to think that a Help button is not going to be all that helpful. Maybe something like this:

Find Latest DriversContinue Anyway

Are you also writing the documentation that this links to? I guess we would adapt the existing GPU troubleshooting text, and add specific links and instructions for where to get Intel, AMD and NVIDIA drivers.

source/blender/gpu/intern/gpu_private.h
26

Nitpick, add empty line below.

I think we should name the buttons something else than Help and Ok, I expect many of users will just click Ok without reading. At least for me personally, I'm sort of conditioned to think that a Help button is not going to be all that helpful. Maybe something like this:

Find Latest DriversContinue Anyway

I do agree, but we will not be able to do so with the default windows message box. We need to develop a custom dialog for that.

Are you also writing the documentation that this links to? I guess we would adapt the existing GPU troubleshooting text, and add specific links and instructions for where to get Intel, AMD and NVIDIA drivers.

I haven't done it at this moment. I can do this later today.

Brecht Van Lommel (brecht) requested changes to this revision.Fri, Oct 4, 2:35 PM

On Linux, pressing Ok or Help in a Limited support dialog does not close it and I get this error in the console:

XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":1"
      after 245 requests (245 known processed) with 0 events remaining.
intern/ghost/intern/GHOST_SystemX11.cpp
2330

Warning to be silenced:

intern/ghost/intern/GHOST_SystemX11.cpp:2330:15: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
         system(cmd.c_str());
         ~~~~~~^~~~~~~~~~~~~
source/blender/gpu/intern/gpu_platform.c
63

GPU_DEVICE_ANY -> GPU_DRIVER_ANY

64

Someone will still need to fill in this list, we need a task tagged with 2.81 after this is committed.

119

Just to be sure we could add this, so the assumption of one key per line works:

BLI_str_replace_char(support_key, '\n', ' ');
BLI_str_replace_char(support_key, '\r', ' ');
This revision now requires changes to proceed.Fri, Oct 4, 2:35 PM

We can commit this without the better button labels, and then add them as a second step.

It would also be good to show the detected GPU in this dialog box (format the same as we do for Help > Report a Bug maybe).

That saves the users from having to look up the model, and in case of graphics card switching might make it clear when it's using the integrated card.

Jeroen Bakker (jbakker) marked 3 inline comments as done.
  • Fixed Memory leak
  • Correct cleanup of X11 message box
  • silent warning
  • Correct data in support tests array
  • fixed possible issues when opengl drivers return vendor, renderer or version using multiple lines

One trivial issue to resolve, other than that looks good.

Follow up tasks:

source/blender/windowmanager/intern/wm_platform_support.c
86

Change latest to dev since the 2.80 manual does not have this info.

We could change it after the release, though maybe it is better regardless to always link to the very latest manual, in case the driver download links change or we want to add extra info.

This revision is now accepted and ready to land.Fri, Oct 4, 3:57 PM

Added GPU Name to the message boxes.
Made the X11 Message box not resizable

Jeroen Bakker (jbakker) marked 3 inline comments as done.

Changed redirect links

This revision was automatically updated to reflect the committed changes.