Wesley
Wesley

Reputation: 1

Linker can't load Nvidia Management Library

I am trying to install the CUDA toolkit onto my Ubuntu machine so that I can work on some CUDA code. I believe I have installed CUDA 8.0 correctly as shown by the output of nvcc --version and nvidia-smi.

    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2016 NVIDIA Corporation
    Built on Tue_Jan_10_13:22:03_CST_2017
    Cuda compilation tools, release 8.0, V8.0.61

    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 384.90                 Driver Version: 384.90                    |
    |-------------------------------+----------------------+----------------------+
    | 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 820M        Off  | 00000000:01:00.0 N/A |                  N/A |
    | N/A   45C    P8    N/A /  N/A |     18MiB /  1985MiB |     N/A      Default |
    +-------------------------------+----------------------+----------------------+

    +-----------------------------------------------------------------------------+
    | Processes:                                                       GPU Memory |
    |  GPU       PID   Type   Process name                             Usage      |
    |=============================================================================|
    |    0                    Not Supported                                       |
    +-----------------------------------------------------------------------------+

I have also added the path variable extensions as mentioned in the Nvidia CUDA installation guide. The code I am working on requires links to several libraries in the Nvidia toolkit, namely -lcuda, -lnvrtc, and -lnvidia-ml. The compiler can find the first two just fine, but gives an error saying it can't find the library for Nvidia Management Library.

    /usr/bin/ld: cannot find -lnvidia-ml

The CUDA 8.0 toolkit should have the Nvidia Management Library already included as far as I am aware so any ideas why the linker can't find it?

Upvotes: 0

Views: 884

Answers (1)

Robert Crovella
Robert Crovella

Reputation: 151839

That library is actually installed by the driver, not by the CUDA toolkit (NVML is actually not part of CUDA), and it ends up in a different location than the usual CUDA libraries. The actual location may be distro-dependent.

Anyway, run something like this:

sudo find / -name libnvidia-ml.* 

to find out where the library is located. Then pass the path to that location as a -L linker switch, prior to -lnvidia-ml, like:

-L/path/to/libnvidia-ml -lnvidia-ml

Upvotes: 1

Related Questions