January 28, 2018 4:11 PMnode
archlinux是最新更新版本,gcc版本到了7.几,太新了。linux
[qiangge@lqspc ~]$ gcc --version gcc (GCC) 7.2.1 20180116 Copyright © 2017 Free Software Foundation, Inc. 本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保; 包括没有适销性和某一专用目的下的适用性担保。
这系统对中文翻译的不太习惯哈。bash
整体步骤app
pa cuda
,结果就给我装了个9.1的版本。反复测试发现安装失败。通过查询显卡型号(上一步)支持的计算能力(compute capability?但愿没拼错)只是支持1.2如下,后来安装完发现是1.1.而1.2如下的最多安装cuda-6.5之前的版本。yaourt cuda
找到相关版本安装(上一步),安装过程当中遇到/tmp不够用,新建个目录挂载到/tmp,冲掉了内存挂载的/tmp,这样能够充分利用硬盘空间来操做。之因此不够用由于内存只有8G,这样默认/tmp就只有4G,废话了。/opt/cuda/samples
的devicequery例子,最好拷贝到本身的/home目录吧。(1)Here is a patch to /usr/include/bits/floatn.h for avoiding __FLOAT128 only when compiling via NVCC (2)Here is how to use other GCC compiing via NVCC
不编译cuda代码
的意思。sudo ln -s /usr/lib/libisl.so /usr/lib/libisl.so.10 && sudo ldconfig
否则会失败,固然做为折腾专家,我必须先不加看看效果,果真不行学习
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.4/cc1plus: error while loading shared libraries: libisl.so.10: cannot open shared object file: No such file or directory make: *** [Makefile:196:bandwidthTest.o] 错误 1
加上还提示另一个错误,这个是做者没考虑的吧,哈哈测试
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.4/cc1plus: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
解决办法是相同的思路,类似的代码,读者自行思考哈。ui
[qiangge@lqspc ~]$ ll /opt/cuda/ bin/ jre/ libnvvp/ samples/ doc/ lib/ NVIDIA_SLA_cuDNN_Support.txt share/ extras/ lib64/ nvvm/ src/ include/ libnsight/ open64/ tools/ [qiangge@lqspc ~]$ ll /opt/cuda/bin/gcc/ 总用量 8.0K drwxr-xr-x 2 root 4.0K 1月 28 22:52 . lrwxrwxrwx 1 root 16 1月 28 22:52 gcc -> /usr/bin/gcc-4.7 lrwxrwxrwx 1 root 16 1月 28 22:52 cpp -> /usr/bin/cpp-4.7 lrwxrwxrwx 1 root 16 1月 28 22:52 g++ -> /usr/bin/g++-4.7 drwxr-xr-x 4 root 4.0K 1月 22 09:45 .. [qiangge@lqspc ~]$
[qiangge@lqspc 1_Utilities]$ cd bandwidthTest/ [qiangge@lqspc bandwidthTest]$ nvidia-smi Mon Jan 29 00:01:22 2018 +------------------------------------------------------+ | NVIDIA-SMI 340.106 Driver Version: 340.106 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce G 110M Off | 0000:01:00.0 N/A | N/A | | N/A 52C P12 N/A / N/A | 50MiB / 255MiB | N/A Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Compute processes: GPU Memory | | GPU PID Process name Usage | |=============================================================================| | 0 Not Supported | +-----------------------------------------------------------------------------+ [qiangge@lqspc bandwidthTest]$
[qiangge@lqspc bandwidthTest]$ ./bandwidthTest [CUDA Bandwidth Test] - Starting... Running on... Device 0: GeForce G 110M Quick Mode Host to Device Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 2551.5 Device to Host Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 1675.0 Device to Device Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 6319.8 Result = PASS [qiangge@lqspc bandwidthTest]$
[qiangge@lqspc 1_Utilities]$ cd deviceQuery [qiangge@lqspc deviceQuery]$ ls deviceQuery deviceQuery.cpp deviceQuery.o Makefile NsightEclipse.xml readme.txt [qiangge@lqspc deviceQuery]$ ./deviceQuery ./deviceQuery Starting... CUDA Device Query (Runtime API) version (CUDART static linking) Detected 1 CUDA Capable device(s) Device 0: "GeForce G 110M" CUDA Driver Version / Runtime Version 6.5 / 6.5 CUDA Capability Major/Minor version number: 1.1 Total amount of global memory: 256 MBytes (268107776 bytes) ( 2) Multiprocessors, ( 8) CUDA Cores/MP: 16 CUDA Cores GPU Clock rate: 1000 MHz (1.00 GHz) Memory Clock rate: 700 Mhz Memory Bus Width: 64-bit Maximum Texture Dimension Size (x,y,z) 1D=(8192), 2D=(65536, 32768), 3D=(2048, 2048, 2048) Maximum Layered 1D Texture Size, (num) layers 1D=(8192), 512 layers Maximum Layered 2D Texture Size, (num) layers 2D=(8192, 8192), 512 layers Total amount of constant memory: 65536 bytes Total amount of shared memory per block: 16384 bytes Total number of registers available per block: 8192 Warp size: 32 Maximum number of threads per multiprocessor: 768 Maximum number of threads per block: 512 Max dimension size of a thread block (x,y,z): (512, 512, 64) Max dimension size of a grid size (x,y,z): (65535, 65535, 1) Maximum memory pitch: 2147483647 bytes Texture alignment: 256 bytes Concurrent copy and kernel execution: Yes with 1 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): No Device PCI Bus ID / PCI location ID: 1 / 0 Compute Mode: < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 6.5, CUDA Runtime Version = 6.5, NumDevs = 1, Device0 = GeForce G 110M Result = PASS [qiangge@lqspc deviceQuery]$
配置虽然低,学习可可以用吧,不行就去买个新点的台式二手显卡?二手是否是抠门了呢?的确是,可是其实本身不用买,公司有1080TI显卡,能够加班学习用就好了。这里只是想本身安装一次,而且能够简单用来学习、练习和测试。同时帮朋友解决了y550上cuda65,那个显卡是g 240m的样子,最多也是1.2的计算能力。可是他用的Ubuntu。臃肿的Ubuntu还不是个人菜。以后又发现本身硬盘快满了,原来是须要pacman -Sc
一下了。回头考虑配置一下自动清除不安装的包吧。google