CUDA 12.2 install | pkgconfig missing

OS: Linux
Flavor: CentOS Linx 7 (Core)
build type: run file (cuda_12.2.1_535.86.10_linux.run)
command: bash cuda_12.2.1_535.86.10_linux.run --silent --toolkit --installpath=/home1/apps/cuda/12.2

Hello,

I’m attempting to install CUDA 12.2 on our linux system with the specs above and using the run file provided by NVIDIA. It install’s correctly, but is missing the pkgconfig folder in the install directory. Here is a list of all installed elements from CUDA.

root@build-BLDCHROOT:12.2 # ls                                                                                          
bin                extras    lib64                    nsight-systems-2023.2.3  README   tools                           
compute-sanitizer  gds       libnvvp                  nvml                     share    version.json   
DOCS               gds-12.2  nsight-compute-2023.2.1  nvvm                     src                                      
EULA.txt           include   nsightee_plugin          targets

Our team uses the pkgconfig folder to check the installation for other builds, and it was on previous installations but for some reason is missing on this one. Is there any solution to get it to build with the correct pkgconfig folder?

Thanks.

Did you check in /usr/lib/pkgconfig (Ubuntu) or /usr/lib64/pkgconfig (CentOS)?

Hi Robert.

I checked the install location of cuda that I defined in my code above and there is a lib64 directory but it only contains the library files along with a cmake and stubs folder which do not contain the associated .pc files we are looking for.

cmake                         libcufile_static.a           libnppicc.so.12         libnpps.so.12.2.0.5
libaccinj64.so                libcufilt.a                  libnppicc.so.12.2.0.5   libnpps_static.a
libaccinj64.so.12.2           libcuinj64.so                libnppicc_static.a      libnvblas.so
libaccinj64.so.12.2.131       libcuinj64.so.12.2           libnppidei.so           libnvblas.so.12
libcublasLt.so                libcuinj64.so.12.2.131       libnppidei.so.12        libnvblas.so.12.2.4.5
libcublasLt.so.12             libculibos.a                 libnppidei.so.12.2.0.5  libnvJitLink.so
libcublasLt.so.12.2.4.5       libcurand.so                 libnppidei_static.a     libnvJitLink.so.12
libcublasLt_static.a          libcurand.so.10              libnppif.so             libnvJitLink.so.12.2.128
libcublas.so                  libcurand.so.10.3.3.129      libnppif.so.12          libnvJitLink_static.a
libcublas.so.12               libcurand_static.a           libnppif.so.12.2.0.5    libnvjpeg.so
libcublas.so.12.2.4.5         libcusolver_lapack_static.a  libnppif_static.a       libnvjpeg.so.12
libcublas_static.a            libcusolver_metis_static.a   libnppig.so             libnvjpeg.so.12.2.1.2
libcudadevrt.a                libcusolverMg.so             libnppig.so.12          libnvjpeg_static.a
libcudart.so                  libcusolverMg.so.11          libnppig.so.12.2.0.5    libnvptxcompiler_static.a
libcudart.so.12               libcusolverMg.so.11.5.1.129  libnppig_static.a       libnvrtc-builtins.so
libcudart.so.12.2.128         libcusolver.so               libnppim.so             libnvrtc-builtins.so.12.2
libcudart_static.a            libcusolver.so.11            libnppim.so.12          libnvrtc-builtins.so.12.2.128
libcufft.so                   libcusolver.so.11.5.1.129    libnppim.so.12.2.0.5    libnvrtc-builtins_static.a
libcufft.so.11                libcusolver_static.a         libnppim_static.a       libnvrtc.so
libcufft.so.11.0.8.91         libcusparse.so               libnppist.so            libnvrtc.so.12
libcufft_static.a             libcusparse.so.12            libnppist.so.12         libnvrtc.so.12.2.128
libcufft_static_nocallback.a  libcusparse.so.12.1.2.129    libnppist.so.12.2.0.5   libnvrtc_static.a
libcufftw.so                  libcusparse_static.a         libnppist_static.a      libnvToolsExt.so
libcufftw.so.11               libmetis_static.a            libnppisu.so            libnvToolsExt.so.1
libcufftw.so.11.0.8.91        libnppc.so                   libnppisu.so.12         libnvToolsExt.so.1.0.0
libcufftw_static.a            libnppc.so.12                libnppisu.so.12.2.0.5   libOpenCL.so
libcufile_rdma.so             libnppc.so.12.2.0.5          libnppisu_static.a      libOpenCL.so.1
libcufile_rdma.so.1           libnppc_static.a             libnppitc.so            libOpenCL.so.1.0
libcufile_rdma.so.1.7.1       libnppial.so                 libnppitc.so.12         libOpenCL.so.1.0.0
libcufile_rdma_static.a       libnppial.so.12              libnppitc.so.12.2.0.5   stubs
libcufile.so                  libnppial.so.12.2.0.5        libnppitc_static.a
libcufile.so.0                libnppial_static.a           libnpps.so
libcufile.so.1.7.1            libnppicc.so                 libnpps.so.12

It’s not in that location.

For example, on CentOS, I installed CUDA 12.1 via the runfile installer method.

Most of the “CUDA stuff” gets put in /usr/local/cuda-12.1/

However in another location, that is not part of the above path, specifically here:

/usr/lib64/pkgconfig

I observe the following:

$ ls /usr/lib64/pkgconfig
accinj64-11.6.pc  cuinj64-12.1.pc   nppicom-12.0.pc  npps-11.7.pc
accinj64-11.7.pc  curand-10.2.pc    nppidei-11.6.pc  npps-11.8.pc
accinj64-11.8.pc  curand-10.3.pc    nppidei-11.7.pc  npps-12.0.pc
accinj64-12.0.pc  cusolver-11.3.pc  nppidei-11.8.pc  nvidia-ml-11.6.pc
accinj64-12.1.pc  cusolver-11.4.pc  nppidei-12.0.pc  nvidia-ml-11.7.pc
cublas-11.pc      cusparse-11.7.pc  nppif-11.6.pc    nvidia-ml-11.8.pc
cublas-12.pc      cusparse-12.0.pc  nppif-11.7.pc    nvidia-ml-12.0.pc
cuda-11.6.pc      libcurl.pc        nppif-11.8.pc    nvidia-ml-12.1.pc
cuda-11.7.pc      libdw.pc          nppif-12.0.pc    nvjitlink-12.0.pc
cuda-11.8.pc      libelf.pc         nppig-11.6.pc    nvjitlink-12.1.pc
cuda-12.0.pc      liblzma.pc        nppig-11.7.pc    nvjpeg-11.6.pc
cuda-12.1.pc      nppc-11.6.pc      nppig-11.8.pc    nvjpeg-11.7.pc
cudart-11.6.pc    nppc-11.7.pc      nppig-12.0.pc    nvjpeg-11.9.pc
cudart-11.7.pc    nppc-11.8.pc      nppim-11.6.pc    nvjpeg-12.0.pc
cudart-11.8.pc    nppc-12.0.pc      nppim-11.7.pc    nvjpeg-12.1.pc
cudart-12.0.pc    nppi-11.6.pc      nppim-11.8.pc    nvrtc-11.6.pc
cudart-12.1.pc    nppi-11.7.pc      nppim-12.0.pc    nvrtc-11.7.pc
cufft-10.7.pc     nppi-11.8.pc      nppist-11.6.pc   nvrtc-11.8.pc
cufft-10.9.pc     nppi-12.0.pc      nppist-11.7.pc   nvrtc-12.0.pc
cufft-11.0.pc     nppial-11.6.pc    nppist-11.8.pc   nvrtc-12.1.pc
cufftw-10.7.pc    nppial-11.7.pc    nppist-12.0.pc   nvToolsExt-11.6.pc
cufftw-10.9.pc    nppial-11.8.pc    nppisu-11.6.pc   nvToolsExt-11.7.pc
cufftw-11.0.pc    nppial-12.0.pc    nppisu-11.7.pc   nvToolsExt-11.8.pc
cufile-1.4.pc     nppicc-11.6.pc    nppisu-11.8.pc   nvToolsExt-12.0.pc
cufile-1.5.pc     nppicc-11.7.pc    nppisu-12.0.pc   nvToolsExt-12.1.pc
cufile-1.6.pc     nppicc-11.8.pc    nppitc-11.6.pc   opencl-12.0.pc
cuinj64-11.6.pc   nppicc-12.0.pc    nppitc-11.7.pc   opencl-12.1.pc
cuinj64-11.7.pc   nppicom-11.6.pc   nppitc-11.8.pc   systemd.pc
cuinj64-11.8.pc   nppicom-11.7.pc   nppitc-12.0.pc   zlib.pc
cuinj64-12.0.pc   nppicom-11.8.pc   npps-11.6.pc
$

Note that I have other runfile installs on this machine, so not all of the above files are due to CUDA 12.1 installation.

Hi Robert,

Gotcha, I looked inside the directory /usr/lib64/pkgconfig and there is indeed a cuda-12.2.pc file.

Out of curiosity is there anyway to control the installation of this file, or is this something that is done automatically by the runfile?

Thanks.

I’m not aware of any method to control where it gets installed. The runfile installer has command line help available.

Hi Robert,

I noticed that with the runfile you can extract the underlying driver runfile and source code such as NVIDIA-Linux-x86_64-535.86.10.run which has more options.

I was attempting to install by running this file, but it says that it needs to be run as root. Is there a way to run it without root? I can run the original runfile not as root but wasn’t should how to actual driver runfile as nonroot.

Thanks.

The runfile driver installer definitely needs root privilege to install the driver. I’m not aware of a method to circumvent that. The driver installer does not know anything about CUDA toolkit components. Therefore it could not possibly install or deposit any pkgconfig files that pertain to the CUDA toolkit, such as cuda-12.2.pc.

The CUDA toolkit installer, on the other hand, can install certain CUDA toolkit components (everything except the driver, basically) without root privilege, if you specify paths correctly. Therefore it makes sense that it would not require root privilege. However if you attempt to run the CUDA toolkit runfile installer without root, and attempt to install the driver that way, it will fail.