Пара дней назад мне удалось получить CUDA, работающую с тензорным потоком на моем Mac с GeForce GTX 780M. Однако сегодня я заметил, что он больше не работает. Я не уверен, что изменилось, но я проверил, что библиотеки (особенно cudann) по-прежнему установлены правильно.CUDA не может найти GPU на mac
Ни перезагрузка, ни переустановка tensorflow помог (я установил tensorflow от https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-0.12.1-py3-none-any.whl) Вот выход из запуска mnist пример с сайта tensorflow:
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.dylib locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.dylib locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.dylib locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.1.dylib locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.dylib locally
Extracting MNIST_data/train-images-idx3-ubyte.gz
Extracting MNIST_data/train-labels-idx1-ubyte.gz
Extracting MNIST_data/t10k-images-idx3-ubyte.gz
Extracting MNIST_data/t10k-labels-idx1-ubyte.gz
E tensorflow/stream_executor/cuda/cuda_driver.cc:509] failed call to cuInit: CUDA_ERROR_NO_DEVICE
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:158] retrieving CUDA diagnostic information for host: Net-iMac-3.local
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: Net-iMac-3.local
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] libcuda reported version is: 310.42.25
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193] kernel reported version is: Invalid argument: expected %d.%d or %d.%d.%d form for driver version; got ""
step 0, training accuracy 0.06
Вот выход nvcc -V
:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Sun_Oct_30_22:18:43_CDT_2016
Cuda compilation tools, release 8.0, V8.0.54
Выходной сигнал: ls -l /usr/local/cuda/lib/libcud*
lrwxr-xr-x 1 mik admin 33B Jan 7 16:29 /usr/local/cuda/lib/libcuda.1.dylib -> /usr/local/cuda/lib/libcuda.dylib
[email protected] 1 root wheel 13K Nov 3 19:39 /usr/local/cuda/lib/libcuda.dylib
[email protected] 1 root wheel 45B Nov 3 19:40 /usr/local/cuda/lib/libcudadevrt.a -> /Developer/NVIDIA/CUDA-8.0/lib/libcudadevrt.a
[email protected] 1 root wheel 50B Nov 3 19:40 /usr/local/cuda/lib/libcudart.8.0.dylib -> /Developer/NVIDIA/CUDA-8.0/lib/libcudart.8.0.dylib
[email protected] 1 root wheel 46B Nov 3 19:40 /usr/local/cuda/lib/libcudart.dylib -> /Developer/NVIDIA/CUDA-8.0/lib/libcudart.dylib
[email protected] 1 root wheel 49B Nov 3 19:40 /usr/local/cuda/lib/libcudart_static.a -> /Developer/NVIDIA/CUDA-8.0/lib/libcudart_static.a
[email protected] 1 mik staff 74M Jul 27 09:18 /usr/local/cuda/lib/libcudnn.5.dylib
[email protected] 1 mik staff 16B Jul 27 09:21 /usr/local/cuda/lib/libcudnn.dylib -> libcudnn.5.dylib
[email protected] 1 mik staff 63M Jul 27 09:18 /usr/local/cuda/lib/libcudnn_static.a
Я попытался переустановить драйверы, установка старых и ни один из них не помог
По https://github.com/aymericdamien/TensorFlow-Examples/issues/38 я export CUDA_VISIBLE_DEVICES=1
, чтобы предотвратить проблемы с памятью при работе tensorflow. Если я после этого запустить ./deviceQuery
он не может найти ГПУ:
/Developer/NVIDIA/CUDA-8.0/samples/bin/x86_64/darwin/release/deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL
Однако, если я бегу export CUDA_VISIBLE_DEVICES=0
то работает ./deviceQuery
дает:
/Developer/NVIDIA/CUDA-8.0/samples/bin/x86_64/darwin/release/deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GeForce GTX 780M"
CUDA Driver Version/Runtime Version 8.0/8.0
CUDA Capability Major/Minor version number: 3.0
Total amount of global memory: 4096 MBytes (4294508544 bytes)
(8) Multiprocessors, (192) CUDA Cores/MP: 1536 CUDA Cores
GPU Max Clock rate: 784 MHz (0.78 GHz)
Memory Clock rate: 2500 Mhz
Memory Bus Width: 256-bit
L2 Cache Size: 524288 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 2 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID/Bus ID/location ID: 0/1/0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
deviceQuery, CUDA
Проверьте установку CUDA, используя процедуры, указанные в руководстве по установке CUDA MaOS. –
работает './DeviceQuery' не находит gpu – Michal
Может ли это быть вызвано тем, что мой gpu относительно старый по сравнению с cuda 8.0? – Michal