microsoft / DirectML

DirectML is a high-performance, hardware-accelerated DirectX 12 library for machine learning. DirectML provides GPU acceleration for common machine learning tasks across a broad range of supported hardware and drivers, including all DirectX 12-capable GPUs from vendors such as AMD, Intel, NVIDIA, and Qualcomm.
MIT License
2.26k stars 301 forks source link

How can I address these warning messages on my first directml attempt? #117

Open richtj opened 3 years ago

richtj commented 3 years ago

Hi, please help, with my initial foray I get the output below. I am concerned especially about the message about the TensorFlow binary. I am using Intel i9-10800HK CPU and running WSL2 with PengWin, kernel version as follows:

PS C:\Users\stati> wsl cat /proc/version Linux version 5.10.16.3-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Apr 2 22:23:49 UTC 2021

(directml) TJRalien:~> python Python 3.6.13 |Anaconda, Inc.| (default, Feb 23 2021, 21:15:04) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import tensorflow.compat.v1 as tf tf.enable_eager_execution(tf.ConfigProto(log_device_placement=True)) print(tf.add([1.0, 2.0], [3.0, 4.0])) 2021-05-03 21:51:16.975747: I tensorflow/stream_executor/platform/default/dso_loader.cc:99] Successfully opened dynamic library libdirectml.adbd007a01a52364381a1c71ebb6fa1b2389c88d.so NVD3D10: CPU cyclestats are disabled on client virtualization 2021-05-03 21:51:19.787350: I tensorflow/core/common_runtime/dml/dml_device_cache.cc:249] DirectML device enumeration: found 1 compatible adapters. 2021-05-03 21:51:19.787701: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA NVD3D10: CPU cyclestats are disabled on client virtualization 2021-05-03 21:51:20.809670: I tensorflow/core/common_runtime/dml/dml_device_cache.cc:185] DirectML: creating device on adapter 0 (NVIDIA GeForce RTX 3080 Laptop GPU NVD3D10: CPU cyclestats are disabled on client virtualization NVD3D10: CPU cyclestats are disabled on client virtualization 2021-05-03 21:51:21.862957: I tensorflow/core/common_runtime/eager/execute.cc:571] Executing op Add in device /job:localhost/replica:0/task:0/device:DML:0 tf.Tensor([4. 6.], shape=(2,), dtype=float32)

jstoecker commented 3 years ago

Hi there! Everything in this log looks normal -- I can tell that it's running correctly on your NVIDIA graphics card (DML:0 = NVIDIA GeForce RTX 3080). I can explain some of the messages though.

NVD3D10: CPU cyclestats

NVD3D10: CPU cyclestats are disabled on client virtualization

This message originates from the NVIDIA preview WSL driver. I expect this will go away once NVIDIA finishes their stable release driver that supports WSL (WSL2+graphics/compute is still in a preview state). Nothing to be worried about right now!

AVX Warning

2021-05-03 21:51:19.787701: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

The versions of TFDML that we push to pypi.org are compiled with AVX instructions, but not AVX2. The message says that your CPU supports AVX2 so it might be faster if you compiled TF with AVX2 support. We don't build with AVX2 support because it would prevent some processors from being able to run at all. However, you have the option of building TFDML with AVX2 support yourself. It's unlikely to make any difference in performance because most computation should be accelerated by your graphics card, not your CPU.

This isn't unique to tensorflow-directml, and you'd see the same message when using Google's version of tensorflow. See https://stackoverflow.com/questions/47068709/your-cpu-supports-instructions-that-this-tensorflow-binary-was-not-compiled-to-u for the top answer, which is relevant to DML use as well. It also explains how to suppress the warnings if you don't want to see them.