Be able to share compiled OpenCL binary caches among identical GPUs#187
Be able to share compiled OpenCL binary caches among identical GPUs#187harokyang wants to merge 4 commits into
Conversation
…uring a multi-device rendering
|
Can somebody give me a hint about the jenkins build report? |
| SaveBinaries(cached_program_path, binary); | ||
|
|
||
| // Block other workers until binary cache generated | ||
| cache_lock.unlock(); |
There was a problem hiding this comment.
This unlock is excessive since the cache_lock goes out of scope right after the call.
| CLWContext m_context; | ||
| std::set<std::string> m_included_headers; ///< Set of included headers | ||
|
|
||
| static std::unordered_map<std::string, std::shared_ptr<std::mutex>> s_binary_cache_names; |
There was a problem hiding this comment.
It's not a part of the class interface, so it might be moved into the .cpp file.
|
Hello, according to the build logs the test 'AovTest.Aov_ObjectId' is failed. You should be able to reproduce this issue on Ubuntu/Windows machines. Looks like this is permanent issue for all of them. Try to launch Baikal unit tests |
|
Thanks, I will look into it |
|
The |
|
Yes, seems the only way to solve the issue is by update the unit test reference image And no more static required when put m_default_material inside the scene object |
This change solved the following issue
Because each worker thread use its own instance of default_material in ClwSceneController, which has its own SceneObject id
Different SceneObject id means different inputmap id, lead to different inputmap.cl
Change default_material from member variable to static variable solve this issue
But if there is no cache exists, all the GPUs will try to compile and generate the very same binary cache, at the same time
This may cause a huge spike in memory consumption with lots of wasted works
Added a lock mechanism to allow only one worker to compile and generate binary cache, while the others will simply wait for it
Any workers with different GPU/CPU model won't be affected and will be able to generate their own version of kernel binaries