1

当我遵循本教程时,如何在 ubuntu wsl 上启用我的 amd gpu:https ://docs.microsoft.com/en-us/windows/ai/directml/gpu-tensorflow-wsl并执行

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-11-23 06:41:12.602507: W tensorflow/stream_executor/platform/default/dso_loader.cc:108] Could not load dynamic library 'libdirectml.24bfac66e4ee42ec393a5fb471412d0177bc7bcf.so'; dlerror: libd3d12.so: cannot open shared object file: No such file or directory

2021-11-23 06:41:12.604163: W tensorflow/core/common_runtime/dml/dml_device_cache.cc:137] Could not load DirectML.

2021-11-23 06:41:12.604268: I tensorflow/core/common_runtime/dml/dml_device_cache.cc:250] DirectML device enumeration: found 0 compatible adapters.

2021-11-23 06:41:12.607610: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

2021-11-23 06:41:12.619264: I tensorflow/core/common_runtime/eager/execute.cc:571] Executing op Add in device /job:localhost/replica:0/task:0/device:CPU:0

tf.Tensor([4. 6.], shape=(2,), dtype=float32)

代替

2020-06-15 11:27:18.235973: I tensorflow/core/common_runtime/dml/dml_device_factory.cc:45] DirectML device enumeration: found 1 compatible adapters.

2020-06-15 11:27:18.240065: I tensorflow/core/common_runtime/dml/dml_device_factory.cc:32] DirectML: creating device on adapter 0 (AMD Radeon VII)

2020-06-15 11:27:18.323949: I tensorflow/stream_executor/platform/default/dso_loader.cc:60] Successfully opened dynamic library libdirectml.so.ba106a7c621ea741d21598708ee581c11918380

2020-06-15 11:27:18.337830: 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)
4

0 回答 0