cuda9.0 + cunn 7.05 on ubuntu 18.04

Asus GTX 950m

安裝步驟 

除了 cuda 9.0 多了 patch3 我都有裝

sudo dpkg -i cuda-repo-ubuntu1704-9-0-local_9.0.176-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1704-9-0-local-cublas-performance-update_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1704-9-0-local-cublas-performance-update-2_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1704-9-0-local-cublas-performance-update-3_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda-9-0


pip 安裝 Tensorflow,目前最新是 1.8.0:

如何安裝pip


# refreshing the repositories
sudo apt update
# its wise to keep the system up to date!
# you can skip the following line if you not
# want to update all your software
sudo apt upgrade
# installing python 2.7 and pip for it
sudo apt install python2.7 python-pip
# installing python-pip for 3.6
sudo apt install python3-pip
 
# for python 2.7
pip2 install <package>
# for python 3.6
pip install <package> 
 
#以下兩個我都有裝 !! 這一篇詳細python版本解說:
pip install --upgrade tensorflow-gpu
pip2 install --upgrade tensorflow-gpu 

在terminal 輸入 python or python3 都可以看:
 
zoey@zoey:~$ python3
Python 3.6.5 (default, Apr  1 2018, 05:46:30) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow.python.client import device_lib
>>> device_lib.list_local_devices()
2018-07-22 16:16:58.836274: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-07-22 16:16:58.838262: E tensorflow/stream_executor/cuda/cuda_driver.cc:397] failed call to cuInit: CUDA_ERROR_NO_DEVICE2018-07-22 16:16:58.838308: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:158] retrieving CUDA diagnostic information for host: zoey
2018-07-22 16:16:58.838321: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: zoey
2018-07-22 16:16:58.838368: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] libcuda reported version is: 390.77.0
2018-07-22 16:16:58.838459: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193] kernel reported version is: 396.24.2
2018-07-22 16:16:58.838475: E tensorflow/stream_executor/cuda/cuda_diagnostics.cc:303] kernel version 396.24.2 does not match DSO version 390.77.0 -- cannot find working devices in this configuration
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 3918721683651541451
]
 
Deal with this Error,i try following methods and reboot:
 
zoey@zoey:~/Downloads$ nvidia-smi
Failed to initialize NVML: Driver/library version mismatch
zoey@zoey:~/Downloads$ lsmod | grep nvidia
nvidia_uvm            778240  0
nvidia_drm             40960  11
nvidia_modeset       1085440  5 nvidia_drm
nvidia              14028800  400 nvidia_modeset,nvidia_uvm
drm_kms_helper        167936  2 i915,nvidia_drm
drm                   401408  16 i915,nvidia_drm,drm_kms_helper
ipmi_msghandler        53248  2 nvidia,ipmi_devintf
 
The result is succeeded!!!
 
python
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow.python.client import device_lib
>>> device_lib.list_local_devices()
2018-07-22 16:45:06.598500: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-07-22 16:45:06.655523: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:897] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-07-22 16:45:06.655892: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1392] Found device 0 with properties: 
name: GeForce GTX 950M major: 5 minor: 0 memoryClockRate(GHz): 1.124
pciBusID: 0000:01:00.0
totalMemory: 1.96GiB freeMemory: 1.58GiB
2018-07-22 16:45:06.655911: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1471] Adding visible gpu devices: 0
2018-07-22 16:46:19.401749: I tensorflow/core/common_runtime/gpu/gpu_device.cc:952] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-07-22 16:46:19.401778: I tensorflow/core/common_runtime/gpu/gpu_device.cc:958]      0 
2018-07-22 16:46:19.401789: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0:   N 
2018-07-22 16:46:19.401925: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1084] Created TensorFlow device (/device:GPU:0 with 1333 MB memory) -> physical GPU (device: 0, name: GeForce GTX 950M, pci bus id: 0000:01:00.0, compute capability: 5.0)
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 13521854532983132608
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 1398669312
locality {
  bus_id: 1
  links {
  }
}
incarnation: 4020720722414225743
physical_device_desc: "device: 0, name: GeForce GTX 950M, pci bus id: 0000:01:00.0, compute capability: 5.0"
] 
 
  • test cuda sample 參考這篇 
     
     
      
    
    
    
    


 

留言