Question
When running the example of nvml, an error is reported:
/tmp/tmpxft_00001d31_00000000-4_gpu_monitor.o: In the function ‘main’:
gpu_monitor.c:(.text+0x77): undefined reference to ‘nvmlInit_v2’
gpu_monitor.c:(.text+0x93): undefined reference to ‘nvmlErrorString’
gpu_monitor.c:(.text+0xcd): undefined reference to ‘nvmlDeviceGetCount_v2’
gpu_monitor.c:(.text+0xe9): undefined reference to ‘nvmlErrorString’
gpu_monitor.c:(.text+0x15e): Undefined reference to ‘nvmlDeviceGetHandleByIndex_v2’
gpu_monitor.c:(.text+0x17a): undefined reference to ‘nvmlErrorString’
gpu_monitor.c:(.text+0x1b4): undefined reference to ‘nvmlDeviceGetName’
gpu_monitor.c:(.text+0x1d0): undefined reference to ‘nvmlErrorString’
gpu_monitor.c:(.text+0x208): Undefined reference to ‘nvmlDeviceGetPciInfo_v3’
gpu_monitor.c:(.text+0x224): undefined reference to ‘nvmlErrorString’
gpu_monitor.c:(.text+0x282): undefined reference to ‘nvmlDeviceGetComputeMode’
gpu_monitor.c:(.text+0x2b6): undefined reference to ‘nvmlErrorString’
gpu_monitor.c:(.text+0x318): undefined reference to ‘nvmlDeviceSetComputeMode’
gpu_monitor.c:(.text+0x334): undefined reference to ‘nvmlErrorString’
gpu_monitor.c:(.text+0x379): undefined reference to ‘nvmlErrorString’
gpu_monitor.c:(.text+0x3ce): undefined reference to ‘nvmlDeviceSetComputeMode’
gpu_monitor.c:(.text+0x3ea): undefined reference to ‘nvmlErrorString’
gpu_monitor.c:(.text+0x423): Undefined reference to ‘nvmlDeviceGetPowerUsage’
gpu_monitor.c:(.text+0x43f): undefined reference to ‘nvmlErrorString’
gpu_monitor.c:(.text+0x4a4): undefined reference to ‘nvmlShutdown’
gpu_monitor.c:(.text+0x4c0): undefined reference to ‘nvmlErrorString’
collect2: error: ld returned 1 exit status
Solution:
At the beginning, the above error occurs when compiling with the command nvcc – O example.C example.
compile successfully with the command nvcc – I – L/usr/lib – lnvidia ml example.C – O example
Read More:
- C++ Compile Error: ld returned 1 exit status [How to Solve]
- subprocess installed post-installation script returned error exit status 1
- [Solved] Ubuntu Terminal Error: subprocess installed post-installation script returned error exit status 1
- ubuntu install package Error: subprocess installed post-installation script returned error exit status 10
- [problem solving] the problem of err returned non zero status 1 or status 2 is solved after upgrading python3 in Ubuntu
- [Solved] Centos error: collect2: fatal error: cannot find ‘ld‘
- [Solved] ERROR: Command errored out with exit status 128: git clone -q
- [Solved] Apex Install Error: ERROR: Command errored out with exit status 1
- [Solved] /usr/bin/ld: cannot find crti.o: No such file or directory & /usr/bin/ld: cannot find -lc
- [Solved] ERROR: ld.so: object ‘/$LIB/libonion.so‘ from /etc/ld.so.preload
- Firewall Status View Error: service iptables status [How to Solve]
- hb set Error: OHOS ERROR] Invalid vendor path: /home/openharmony/vendor (openharmony Compile ubuntu20.04 official document)
- Ubuntu sub process/usr/bin/dpkg returned an error code (1) solution
- ./ungrib.exe Start Error: Could not Fould libpng16.so.16 (/etc/ld.so.conf and ldconfig)
- How to Fix Linux sub process /usr/bin/dpkg returned an error code (1)
- [Solved] Any Softwares Install Error in Ubuntu: /usr/bin/dpkg returned an error code
- [Solved] E Sub-process usrbindpkg returned an error code (1)
- Solved: could not find the task ‘G + + build active file, leetcode algorithm ACM compilation and debugging
- The upgrade of Ubuntu results in an error in the compilation of Android Jack [Two Method to Solve]
- [Solved] libgit2 returned: the index is locked; this might be due to a concurrent or crashed process