From 0ad8f65677f1d42f6e9fe26ce90dbd1a3841c396 Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Fri, 18 Jan 2019 02:56:59 +0100 Subject: Cycles: Cast to correct base type when checking requested features --- intern/cycles/render/shader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index df16ae800d0..3ee63e91e8d 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -646,7 +646,7 @@ void ShaderManager::get_requested_graph_features(ShaderGraph *graph, node->get_group()); requested_features->nodes_features |= node->get_feature(); if(node->special_type == SHADER_SPECIAL_TYPE_CLOSURE) { - BsdfNode *bsdf_node = static_cast(node); + BsdfBaseNode *bsdf_node = static_cast(node); if(CLOSURE_IS_VOLUME(bsdf_node->closure)) { requested_features->nodes_features |= NODE_FEATURE_VOLUME; } -- cgit v1.2.3 From c5eb10b1104bb0f15695be5d4394bbb8303ad092 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 18 Jan 2019 19:15:38 +0100 Subject: Fix T60585: Cycles not using all cores on threadripper, after recent changes. --- intern/cycles/util/util_task.cpp | 22 ++++++++++++++-------- intern/cycles/util/util_thread.cpp | 5 ----- intern/cycles/util/util_thread.h | 4 ---- 3 files changed, 14 insertions(+), 17 deletions(-) (limited to 'intern') diff --git a/intern/cycles/util/util_task.cpp b/intern/cycles/util/util_task.cpp index 4241c4aa8cc..6260d8d13ab 100644 --- a/intern/cycles/util/util_task.cpp +++ b/intern/cycles/util/util_task.cpp @@ -225,9 +225,9 @@ int get_num_total_processors(const vector& num_per_node_processors) /* Assign every thread a node on which is should be running, for the best * performance. */ -void distribute_threads_on_nodes(const vector& threads) +vector distribute_threads_on_nodes(const int num_threads) { - const int num_threads = threads.size(); + vector thread_nodes(num_threads, -1); const int num_active_group_processors = system_cpu_num_active_group_processors(); VLOG(1) << "Detected " << num_active_group_processors << " processors " @@ -241,14 +241,14 @@ void distribute_threads_on_nodes(const vector& threads) * have two Cycles/Blender instances running manually set to a different * dies on a CPU. */ VLOG(1) << "Not setting thread group affinity."; - return; + return thread_nodes; } vector num_per_node_processors; get_per_node_num_processors(&num_per_node_processors); if(num_per_node_processors.size() == 0) { /* Error was already repported, here we can't do anything, so we simply * leave default affinity to all the worker threads. */ - return; + return thread_nodes; } const int num_nodes = num_per_node_processors.size(); int thread_index = 0; @@ -273,11 +273,11 @@ void distribute_threads_on_nodes(const vector& threads) { VLOG(1) << "Scheduling thread " << thread_index << " to node " << current_node_index << "."; - threads[thread_index]->schedule_to_node(current_node_index); + thread_nodes[thread_index] = current_node_index; ++thread_index; if(thread_index == num_threads) { /* All threads are scheduled on their nodes. */ - return; + return thread_nodes; } } ++current_node_index; @@ -305,6 +305,8 @@ void distribute_threads_on_nodes(const vector& threads) ++thread_index; current_node_index = (current_node_index + 1) % num_nodes; } + + return thread_nodes; } } // namespace @@ -325,13 +327,17 @@ void TaskScheduler::init(int num_threads) num_threads = system_cpu_thread_count(); } VLOG(1) << "Creating pool of " << num_threads << " threads."; + + /* Compute distribution on NUMA nodes. */ + vector thread_nodes = distribute_threads_on_nodes(num_threads); + /* Launch threads that will be waiting for work. */ threads.resize(num_threads); for(int thread_index = 0; thread_index < num_threads; ++thread_index) { threads[thread_index] = new thread( - function_bind(&TaskScheduler::thread_run, thread_index + 1)); + function_bind(&TaskScheduler::thread_run, thread_index + 1), + thread_nodes[thread_index]); } - distribute_threads_on_nodes(threads); } void TaskScheduler::exit() diff --git a/intern/cycles/util/util_thread.cpp b/intern/cycles/util/util_thread.cpp index 1880eefcb9c..4d30e3f564f 100644 --- a/intern/cycles/util/util_thread.cpp +++ b/intern/cycles/util/util_thread.cpp @@ -58,9 +58,4 @@ bool thread::join() } } -void thread::schedule_to_node(int node) -{ - node_ = node; -} - CCL_NAMESPACE_END diff --git a/intern/cycles/util/util_thread.h b/intern/cycles/util/util_thread.h index d21a7a8c773..9ae9af25e6b 100644 --- a/intern/cycles/util/util_thread.h +++ b/intern/cycles/util/util_thread.h @@ -54,10 +54,6 @@ public: static void *run(void *arg); bool join(); - /* For an existing thread descriptor which is NOT running yet, assign node - * on which it should be running. */ - void schedule_to_node(int node); - protected: function run_cb_; std::thread thread_; -- cgit v1.2.3 From 08871b56bc4db884ce127deb0ea247e740efe813 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 18 Jan 2019 19:45:39 +0100 Subject: Fix T60627: Cycles render hanging on Windows with threadripper CPU. --- intern/numaapi/source/numaapi_win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/numaapi/source/numaapi_win32.c b/intern/numaapi/source/numaapi_win32.c index e278ef612fd..8f1137a7bea 100644 --- a/intern/numaapi/source/numaapi_win32.c +++ b/intern/numaapi/source/numaapi_win32.c @@ -163,7 +163,7 @@ NUMAAPI_Result numaAPI_Initialize(void) { //////////////////////////////////////////////////////////////////////////////// // Internal helpers. -static int countNumSetBits(int64_t mask) { +static int countNumSetBits(ULONGLONG mask) { // TODO(sergey): There might be faster way calculating number of set bits. int num_bits = 0; while (mask != 0) { -- cgit v1.2.3