Skip to content

Commit

Permalink
Don't initialize NVML when not setting affinity. (#5472)
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
  • Loading branch information
mzient authored May 16, 2024
1 parent 768e373 commit 3062216
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dali/pipeline/util/thread_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ ThreadPool::ThreadPool(int num_thread, int device_id, bool set_affinity, const c
, active_threads_(0) {
DALI_ENFORCE(num_thread > 0, "Thread pool must have non-zero size");
#if NVML_ENABLED
// only for the CPU pipeline
if (device_id != CPU_ONLY_DEVICE_ID) {
// We use NVML only for setting thread affinity
if (device_id != CPU_ONLY_DEVICE_ID && set_affinity) {
nvml_handle_ = nvml::NvmlInstance::CreateNvmlInstance();
}
#endif
Expand Down

0 comments on commit 3062216

Please sign in to comment.