每当我在代码中导入tensorflow时,我都会收到以下警告
2021-07-03 20:43:38.432690: E tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
为了检查GPU的可用性,我运行了以下命令:
tf.config.list_physical_devices('GPU')
对于它返回了一个空数组,我不知道。
我也运行了。
tf.test.is_gpu_available()
这返回了一些值得注意的东西
2021-07-03 20:49:02.552671: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2021-07-03 20:49:02.584748: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2394575000 Hz
2021-07-03 20:49:02.585433: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f32e8000b60 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-07-03 20:49:02.585504: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2021-07-03 20:49:02.590168: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2021-07-03 20:49:02.737950: E tensorflow/stream_executor/cuda/cuda_driver.cc:313] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2021-07-03 20:49:02.737996: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (user_name-HP-Pavilion-15-Notebook-PC): /proc/driver/nvidia/version does not exist
False
以下是我的设置规格
Python 3.8.5
TensorFlow 2.2.0
nvcc 10.1
os Ubuntu 20.04 LTS
GPU GM108M [GeForce 830M]
我需要怎样解决这个问题?我想让Tensorflow库在运行代码时使用本地GPU。
编辑:已安装libcudart和libcuda。