如何检查cuda是否在Anaconda上正确安装

时间:2018-08-26 14:48:59

标签: python-3.x tensorflow cuda anaconda

我已经在Anaconda上使用以下命令安装了Cuda

conda install -c anaconda cudatoolkit

之前,我还使用以下命令安装Tensorflow GPU版本

conda install -c anaconda tensorflow-gpu

但是,当我运行以下脚本时,Tensorflow-gpu未激活:

    from tensorflow.python.client import device_lib
    print(device_lib.list_local_devices())

名称:“ / device:CPU:0”

device_type:“ CPU”

memory_limit:268435456

地区 { } 化身:12015853371339101357 ]

1 个答案:

答案 0 :(得分:4)

如果通过anaconda安装numba,则可以运行async function _readSourceDataFromCache (slug_name) { aerospikeClient = aerospikeConf.AerospikeClient; console.log('In async function') console.log(aerospikeClient); return new Promise ( function (resolve, reject) { aerospikeClient.get(aerospikeConf.AerospikeKey, function (error, record) { if (error) { switch (error.code) { case aerospikeConf.Aerospike.status.AEROSPIKE_ERR_RECORD_NOT_FOUND: console.log('NOT_FOUND -', aerospikeConf.AerospikeKey) break default: console.log('ERR - ', error, aerospikeConf.AerospikeKey) } resolve(false) } else{ resp = record['value'] aerospikeClient.close(); return resolve(resp); } }); }) } ,这将确认您是否具有正常运行的CUDA系统。在具有CUDA的Linux系统上:

numba -s

在没有运行CUDA GPU的Windows系统上:

$ numba -s

System info:
--------------------------------------------------------------------------------
__Time Stamp__
2018-08-27 09:16:49.622828

__Hardware Information__
Machine               : x86_64
CPU Name              : ivybridge
CPU Features          : 
aes avx cmov cx16 f16c fsgsbase mmx pclmul popcnt rdrnd sse sse2 sse3 sse4.1
sse4.2 ssse3 xsave xsaveopt

__OS Information__
Platform              : Linux-4.4.0-57-generic-x86_64-with-debian-jessie-sid
Release               : 4.4.0-57-generic
System Name           : Linux
Version               : #78~14.04.1-Ubuntu SMP Sat Dec 10 00:14:47 UTC 2016
OS specific info      : debianjessie/sid
glibc info            : glibc 2.2.5

__Python Information__
Python Compiler       : GCC 4.4.7 20120313 (Red Hat 4.4.7-1)
Python Implementation : CPython
Python Version        : 3.6.0
Python Locale         : en_US UTF-8

__LLVM information__
LLVM version          : 6.0.0

__CUDA Information__
Found 1 CUDA devices
id 0      b'GeForce GTX 970'                              [SUPPORTED]
                      compute capability: 5.2
                           pci device id: 0
                              pci bus id: 1
Summary:
    1/1 devices are supported
CUDA driver version   : 9020
CUDA libraries:
Finding cublas
    named  libcublas.so.8.0.88
    trying to open library...   ok
Finding cusparse
    named  libcusparse.so.8.0.61
    trying to open library...   ok
Finding cufft
    named  libcufft.so.8.0.61
    trying to open library...   ok
Finding curand
    named  libcurand.so.8.0.61
    trying to open library...   ok
Finding nvvm
    named  libnvvm.so.3.1.0
    trying to open library...   ok
    finding libdevice for compute_20... ok
    finding libdevice for compute_30... ok
    finding libdevice for compute_35... ok
    finding libdevice for compute_50... ok

__Conda Information__
conda_build_version   : not installed
conda_env_version     : 4.5.4
platform              : linux-64
python_version        : 3.6.0.final.0
root_writable         : False

__Current Conda Env__
absl-py                   0.1.10                   py36_0  
accelerate_cudalib        2.0                           0  
bleach                    1.5.0                    py36_0  
ca-certificates           2018.03.07                    0  
certifi                   2018.4.16                py36_0  
cffi                      1.9.1                    py36_0  
conda                     4.5.4                    py36_0  
conda-env                 2.6.0                h36134e3_1  
cryptography              1.7.1                    py36_0  
cudatoolkit               8.0                           3  
cudnn                     7.0.5                 cuda8.0_0  
decorator                 4.0.11                   py36_0  
html5lib                  0.9999999                py36_0  
idna                      2.2                      py36_0  
intel-openmp              2018.0.0             hc7b2577_8  
ipython                   5.3.0                    py36_0  
ipython_genutils          0.2.0                    py36_0  
libffi                    3.2.1                         1  
libgcc-ng                 7.2.0                h7cc24e2_2  
libgfortran               3.0.0                         1  
libgfortran-ng            7.2.0                hdf63c60_3  
libprotobuf               3.5.1                h6f1eeef_0  
libstdcxx-ng              7.2.0                hdf63c60_3  
llvmlite                  0.23.2           py36hdbcaa40_0  
markdown                  2.6.11                   py36_0  
mkl                       2018.0.1             h19d6760_4  
mpmath                    0.19                     py36_1  
nccl                      1.3.4                 cuda8.0_1  
numba                     0.38.1           py36h04863e7_0  
numpy                     1.12.1           py36he24570b_1  
openssl                   1.0.2o               h20670df_0  
path.py                   10.1                     py36_0  
pexpect                   4.2.1                    py36_0  
pickleshare               0.7.4                    py36_0  
pip                       9.0.1                    py36_1  
prompt_toolkit            1.0.13                   py36_0  
protobuf                  3.5.1            py36hf484d3e_0  
ptyprocess                0.5.1                    py36_0  
pyasn1                    0.1.9                    py36_0  
pycosat                   0.6.3            py36h0a5515d_0  
pycparser                 2.17                     py36_0  
pyculib                   1.0.2               np112py36_2  
pyculib_sorting           1.0.0                         8  
pygments                  2.2.0                    py36_0  
pyopenssl                 16.2.0                   py36_0  
python                    3.6.0                         0  
pytorch                   0.3.0           py36cuda8.0cudnn7.0_0  
readline                  6.2                           2  
requests                  2.12.4                   py36_0  
ruamel_yaml               0.11.14                  py36_1  
scipy                     1.0.0            py36hbf646e7_0  
setuptools                38.5.1                   py36_0  
simplegeneric             0.8.1                    py36_1  
six                       1.10.0                   py36_0  
sqlite                    3.13.0                        0  
sympy                     1.1.1                    py36_0  
tensorflow                1.4.1                         0  
tensorflow-base           1.4.1            py36hd00c003_2  
tensorflow-tensorboard    1.5.1            py36hf484d3e_0  
tk                        8.5.18                        0  
traitlets                 4.3.2                    py36_0  
wcwidth                   0.1.7                    py36_0  
werkzeug                  0.14.1                   py36_0  
wheel                     0.29.0                   py36_0  
xz                        5.2.2                         1  
yaml                      0.1.6                         0  
zlib                      1.2.11               ha838bed_2  
--------------------------------------------------------------------------------
If requested, please copy and paste the information between
the dashed (----) lines, or from a given specific section as
appropriate.

=============================================================
IMPORTANT: Please ensure that you are happy with sharing the
contents of the information present, any information that you
wish to keep private you should remove before sharing.
=============================================================