Linux环境配置错误记录

1.  pip install --special_version 


pip10.0.1 以上的版本安装包报一堆错误,所以降级为9.0.3 版本。

使用命令:

python -m pip install pip==9.0.3

其中, -m 参数的意思是将库中的python模块用作脚本去运行[1]

run library module as a script (terminates option list)

2.  fusibile make error 


在编译 fusibile 时出现错误

最开始是 cmake .. 都没有通过,因为没找到 OpenCV 链接库,在装好 OpenCV 之后问题解决,顺利通过

然后 make 又出错,错误提示如下

 1 ~/mvsnet/fusibile/build$ make
 2 [ 33%] Building NVCC (Device) object CMakeFiles/fusibile.dir/fusibile_generated_fusibile.cu.o
 3 ptxas info    : 77824 bytes gmem, 72 bytes cmem[3]
 4 ptxas info    : Compiling entry function '_Z8fusibileR11GlobalStatei' for 'sm_30'
 5 ptxas info    : Function properties for _Z8fusibileR11GlobalStatei
 6     8192 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
 7 ptxas info    : Used 47 registers, 332 bytes cmem[0], 20 bytes cmem[2]
 8 ptxas info    : 77824 bytes gmem, 72 bytes cmem[3]
 9 ptxas info    : Compiling entry function '_Z8fusibileR11GlobalStatei' for 'sm_52'
10 ptxas info    : Function properties for _Z8fusibileR11GlobalStatei
11     8192 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
12 ptxas info    : Used 48 registers, 332 bytes cmem[0], 20 bytes cmem[2]
13 /usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
14 /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
15    return (char *) memcpy (__dest, __src, __n) + __n;
16                                           ^
17 CMake Error at fusibile_generated_fusibile.cu.o.cmake:266 (message):
18   Error generating file
19   /home/cvlab/mvsnet/fusibile/build/CMakeFiles/fusibile.dir//./fusibile_generated_fusibile.cu.o
20 
21 
22 CMakeFiles/fusibile.dir/build.make:63: recipe for target 'CMakeFiles/fusibile.dir/fusibile_generated_fusibile.cu.o' failed
23 make[2]: *** [CMakeFiles/fusibile.dir/fusibile_generated_fusibile.cu.o] Error 1
24 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/fusibile.dir/all' failed
25 make[1]: *** [CMakeFiles/fusibile.dir/all] Error 2
26 Makefile:83: recipe for target 'all' failed
27 make: *** [all] Error 2

参考网友【@cheney康编译opencv2.4.13error 的解决方案,对 g++ 版本进行兼容设置,在 CMakeLists.txt 中添加

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES")

再运行make出现下面的信息,应该算是已经通过了?

 1 [ 33%] Building NVCC (Device) object CMakeFiles/fusibile.dir/fusibile_generated_fusibile.cu.o
 2 ptxas info    : 77824 bytes gmem, 72 bytes cmem[3]
 3 ptxas info    : Compiling entry function '_Z8fusibileR11GlobalStatei' for 'sm_30'
 4 ptxas info    : Function properties for _Z8fusibileR11GlobalStatei
 5     8192 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
 6 ptxas info    : Used 47 registers, 332 bytes cmem[0], 20 bytes cmem[2]
 7 ptxas info    : 77824 bytes gmem, 72 bytes cmem[3]
 8 ptxas info    : Compiling entry function '_Z8fusibileR11GlobalStatei' for 'sm_52'
 9 ptxas info    : Function properties for _Z8fusibileR11GlobalStatei
10     8192 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
11 ptxas info    : Used 48 registers, 332 bytes cmem[0], 20 bytes cmem[2]
12 Scanning dependencies of target fusibile
13 [ 66%] Building CXX object CMakeFiles/fusibile.dir/main.cpp.o
14 In file included from /home/cvlab/mvsnet/fusibile/main.cpp:32:0:
15 /home/cvlab/mvsnet/fusibile/helper_cuda.h: In function ‘const char* _cudaGetErrorEnum(CUresult)’:
16 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_PEER_ACCESS_UNSUPPORTED’ not handled in switch [-Wswitch]
17      switch (error)
18             ^
19 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_INVALID_PTX’ not handled in switch [-Wswitch]
20 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_INVALID_GRAPHICS_CONTEXT’ not handled in switch [-Wswitch]
21 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_ILLEGAL_ADDRESS’ not handled in switch [-Wswitch]
22 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_HARDWARE_STACK_ERROR’ not handled in switch [-Wswitch]
23 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_ILLEGAL_INSTRUCTION’ not handled in switch [-Wswitch]
24 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_MISALIGNED_ADDRESS’ not handled in switch [-Wswitch]
25 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_INVALID_ADDRESS_SPACE’ not handled in switch [-Wswitch]
26 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_INVALID_PC’ not handled in switch [-Wswitch]
27 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_NOT_PERMITTED’ not handled in switch [-Wswitch]
28 /home/cvlab/mvsnet/fusibile/helper_cuda.h:293:12: warning: enumeration value ‘CUDA_ERROR_NOT_SUPPORTED’ not handled in switch [-Wswitch]
29 [100%] Linking CXX executable fusibile
30 [100%] Built target fusibile

3. 硬盘挂载问题


问题描述:电脑权限紊乱导致的当前用户无法读取外接硬盘的内容。

硬盘信息展示, Name 是 Linux filesystem,所以我的硬盘是什么格式的呢?

 1 cv@cv:~$ sudo gdisk /dev/sdb
 2 GPT fdisk (gdisk) version 1.0.1
 3 
 4 Partition table scan:
 5   MBR: MBR only
 6   BSD: not present
 7   APM: not present
 8   GPT: not present
 9 
10 ***************************************************************
11 Found invalid GPT and valid MBR; converting MBR to GPT format
12 in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
13 typing 'q' if you don't want to convert your MBR partitions
14 to GPT format!
15 ***************************************************************
16 
17 Command (? for help): p
18 Disk /dev/sdb: 976773168 sectors, 465.8 GiB
19 Logical sector size: 512 bytes
20 Disk identifier (GUID): 060A754F-3991-46DA-9001-5E2C74D4C59B
21 Partition table holds up to 128 entries
22 First usable sector is 34, last usable sector is 976773134
23 Partitions will be aligned on 2048-sector boundaries
24 Total free space is 6125 sectors (3.0 MiB)
25 
26 Number  Start (sector)    End (sector)  Size       Code  Name
27    1            2048       976769023   465.8 GiB   8300  Linux filesystem

让我产生这种疑问的是下面的信息:

 1 cv@cv:~$ sudo fdisk -l
 2 Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
 3 Units: sectors of 1 * 512 = 512 bytes
 4 Sector size (logical/physical): 512 bytes / 4096 bytes
 5 I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
 6 Disklabel type: dos
 7 Disk identifier: 0x49e2c54e
 8 
 9 Device     Boot Start       End   Sectors   Size Id Type
10 /dev/sdb1  *     2048 976769023 976766976 465.8G 83 Linux
1 cv@cv:~$ sudo blkid
2 /dev/sda1: LABEL="M-gM-3M-;M-gM-;M-^_M-dM-?M-^]M-gM-^UM-^Y" UUID="4666209466208731" TYPE="ntfs" PARTUUID="469e8113-01"
3 ...
4 /dev/sda10: UUID="351d9423-6f8c-4c33-9847-5f0ee1804f11" TYPE="ext4" PARTUUID="469e8113-0a"
5 /dev/sdb1: LABEL="Seagate" UUID="7E42F44342F3FE29" TYPE="ntfs" PARTUUID="49e2c54e-01"

硬盘内容明明是存在的,却无法读取到,非常奇怪。

1 cv@cv:~$ ls -lh /media/cv/
2 total 4.0K
3 drwxrwxr-- 2 cv cv 4.0K 3月  27 14:31 Seagate
4 cv@cv:~$ ls -lh /media/cv/Seagate/
5 total 0

4. NVIDIA-SMI(System Management Interface)指标含义


每一项的具体指代意义

Wed Apr  3 11:43:16 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.67                 Driver Version: 390.67                    |
|-------------------------------+----------------------+----------------------+
| 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 GTX 1080    Off  | 00000000:01:00.0  On |                  N/A |
| 42%   36C    P8     8W / 180W |     27MiB /  8118MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1445      G   /usr/lib/xorg/Xorg                            25MiB |
+-----------------------------------------------------------------------------+

Timestamp : Wed Apr 3 11:43:16 2019 

Driver Version:  390.67 

Product Name: The official product name of the GPU. This is an alphanumeric string. GeForce GTX 1080 

Mainly we focus on the GPU Memory-Usage:  27MiB / 8118MiB 

Reference


[1] pip版本降级

[2] 编译opencv 2.4.13error:1 /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope

原文地址:https://www.cnblogs.com/phillee/p/10635267.html