├── debian ├── compat ├── source │ └── format ├── templates │ ├── libnvidia-nscq-BRANCH.install.in │ ├── changelog.in │ └── control.in └── rules ├── .gitignore ├── LICENSE ├── CONTRIBUTING ├── CONTRIBUTING.md └── README.md /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *.buildinfo 3 | *.changes 4 | *.deb 5 | *-archive* 6 | -------------------------------------------------------------------------------- /debian/templates/libnvidia-nscq-BRANCH.install.in: -------------------------------------------------------------------------------- 1 | lib/* #DEBLIBINSTDIR# 2 | -------------------------------------------------------------------------------- /debian/templates/changelog.in: -------------------------------------------------------------------------------- 1 | libnvidia-nscq (#VERSION#-#REVISION#) stable; urgency=low 2 | 3 | * Automatic Debian package build 4 | 5 | -- cudatools #TIMESTAMP# 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 NVIDIA Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /CONTRIBUTING: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 1 Letterman Drive 6 | Suite D4700 7 | San Francisco, CA, 94129 8 | 9 | Everyone is permitted to copy and distribute verbatim copies of this 10 | license document, but changing it is not allowed. 11 | 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I 18 | have the right to submit it under the open source license 19 | indicated in the file; or 20 | 21 | (b) The contribution is based upon previous work that, to the best 22 | of my knowledge, is covered under an appropriate open source 23 | license and I have the right under that license to submit that 24 | work with modifications, whether created in whole or in part 25 | by me, under the same open source license (unless I am 26 | permitted to submit under a different license), as indicated 27 | in the file; or 28 | 29 | (c) The contribution was provided directly to me by some other 30 | person who certified (a), (b) or (c) and I have not modified 31 | it. 32 | 33 | (d) I understand and agree that this project and the contribution 34 | are public and that a record of the contribution (including all 35 | personal information I submit with it, including my sign-off) is 36 | maintained indefinitely and may be redistributed consistent with 37 | this project or the open source license(s) involved. 38 | -------------------------------------------------------------------------------- /debian/templates/control.in: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | # 3 | # Copyright (c) 2020 NVIDIA Corporation 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | # this software and associated documentation files (the "Software"), to deal in 7 | # the Software without restriction, including without limitation the rights to 8 | # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | # the Software, and to permit persons to whom the Software is furnished to do so, 10 | # subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | Source: libnvidia-nscq 23 | Maintainer: cudatools 24 | Section: multiverse/devel 25 | Priority: optional 26 | #Build-Depends: debhelper 27 | Standards-Version: 3.8.0 28 | 29 | Package: libnvidia-nscq-#BRANCH# 30 | Architecture: amd64 arm64 31 | Depends: ${misc:Depends} 32 | Provides: libnvidia-nscq, nscq#SONAME# 33 | Replaces: libnvidia-nscq 34 | Conflicts: libnvidia-nscq 35 | Description: NVSwitch Configuration and Query library 36 | NVIDIA NVSwitch Configuration and Query (NSCQ) library provides a 37 | stable driver API used by DCGM for monitoring NVSwitch devices. 38 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribute to this project 2 | 3 | Want to contribute to this project? Awesome! 4 | We only require you to sign your work, the below section describes this! 5 | 6 | ## Sign your work 7 | 8 | The sign-off is a simple line at the end of the explanation for the patch. Your 9 | signature certifies that you wrote the patch or otherwise have the right to pass 10 | it on as an open-source patch. The rules are pretty simple: if you can certify 11 | the below (from [developercertificate.org](http://developercertificate.org/)): 12 | 13 | ``` 14 | Developer Certificate of Origin 15 | Version 1.1 16 | 17 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 18 | 1 Letterman Drive 19 | Suite D4700 20 | San Francisco, CA, 94129 21 | 22 | Everyone is permitted to copy and distribute verbatim copies of this 23 | license document, but changing it is not allowed. 24 | 25 | Developer's Certificate of Origin 1.1 26 | 27 | By making a contribution to this project, I certify that: 28 | 29 | (a) The contribution was created in whole or in part by me and I 30 | have the right to submit it under the open source license 31 | indicated in the file; or 32 | 33 | (b) The contribution is based upon previous work that, to the best 34 | of my knowledge, is covered under an appropriate open source 35 | license and I have the right under that license to submit that 36 | work with modifications, whether created in whole or in part 37 | by me, under the same open source license (unless I am 38 | permitted to submit under a different license), as indicated 39 | in the file; or 40 | 41 | (c) The contribution was provided directly to me by some other 42 | person who certified (a), (b) or (c) and I have not modified 43 | it. 44 | 45 | (d) I understand and agree that this project and the contribution 46 | are public and that a record of the contribution (including all 47 | personal information I submit with it, including my sign-off) is 48 | maintained indefinitely and may be redistributed consistent with 49 | this project or the open source license(s) involved. 50 | ``` 51 | 52 | Then you just add a line to every git commit message: 53 | 54 | Signed-off-by: Joe Smith 55 | 56 | Use your real name (sorry, no pseudonyms or anonymous contributions.) 57 | 58 | If you set your `user.name` and `user.email` git configs, you can sign your 59 | commit automatically with `git commit -s`. 60 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | # The MIT License (MIT) 4 | # 5 | # Copyright (c) 2020 NVIDIA Corporation 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | # this software and associated documentation files (the "Software"), to deal in 9 | # the Software without restriction, including without limitation the rights to 10 | # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | # the Software, and to permit persons to whom the Software is furnished to do so, 12 | # subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in all 15 | # copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | DH_VERBOSE := 1 25 | 26 | VERSION ?= 999 27 | BRANCH ?= 999 28 | REVISION ?= 1 29 | TIMESTAMP := $(shell date -R) 30 | SONAME := $(shell objdump -p lib/libnvidia-nscq.so.[0-9][0-9][0-9]* | grep SONAME | rev | cut -d . -f 1 | rev) 31 | 32 | ifeq ($(DEB_HOST_ARCH),amd64) 33 | DEBLIBINSTDIR ?= usr/lib/x86_64-linux-gnu 34 | else ifeq ($(DEB_HOST_ARCH),ppc64el) 35 | DEBLIBINSTDIR ?= usr/lib/powerpc64le-linux-gnu 36 | else ifeq ($(DEB_HOST_ARCH),arm64) 37 | DEBLIBINSTDIR ?= usr/lib/aarch64-linux-gnu 38 | endif 39 | 40 | %: 41 | dh $@ 42 | 43 | override_dh_clean: 44 | dh_clean 45 | 46 | override_dh_auto_build: 47 | rm -f lib*.so 48 | 49 | fill_templates: 50 | for template in debian/templates/*.in; do \ 51 | dest=`echo $$template | \ 52 | sed -e "s|\.in\$$||" \ 53 | -e "s|templates\/||" \ 54 | -e "s|BRANCH|$(BRANCH)|"`; \ 55 | sed -e "s|#VERSION#|$(VERSION)|g" \ 56 | -e "s|#BRANCH#|$(BRANCH)|g" \ 57 | -e "s|#SONAME#|$(SONAME)|g" \ 58 | -e "s|#REVISION#|$(REVISION)|g" \ 59 | -e "s|#TIMESTAMP#|$(TIMESTAMP)|g" \ 60 | -e "s|#DEBLIBINSTDIR#|$(DEBLIBINSTDIR)|g" \ 61 | $$template > $$dest; \ 62 | done 63 | 64 | override_dh_auto_install: 65 | dh_install --exclude=none --fail-missing 66 | 67 | override_dh_makeshlibs: 68 | DEB_BUILD_GNU_TYPE=$(DEB_HOST_GNU_TYPE) dh_makeshlibs 69 | 70 | override_dh_auto_configure: 71 | cp -f LICENSE debian/copyright 72 | 73 | # 74 | # Turn off a few of the debhelper scripts 75 | # 76 | override_dh_usrlocal: 77 | 78 | override_dh_strip: 79 | 80 | override_dh_strip_nondeterminism: 81 | 82 | # 83 | # Disable dh_shlibdeps to allow packaging to run on systems which aren't 84 | # the same architecture we're packaging for. 85 | # 86 | override_dh_shlibdeps: 87 | 88 | ifneq ($(DISABLE_FIXPERMS),) 89 | override_dh_fixperms: 90 | endif 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # apt packaging libnvidia nscq 2 | 3 | [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT-license) 4 | [![Contributing](https://img.shields.io/badge/Contributing-Developer%20Certificate%20of%20Origin-violet)](https://developercertificate.org) 5 | 6 | ## Overview 7 | 8 | Packaging templates for `apt` based Linux distros to build libnvidia-nscq packages. 9 | 10 | NVIDIA NVSwitch Configuration and Query (NSCQ) library provides a stable driver API used by [DCGM](https://github.com/NVIDIA/DCGM) for monitoring NVSwitch devices. 11 | 12 | > _note:_ the version of libnvidia-nscq must match the NVIDIA driver installed. 13 | 14 | ## Table of Contents 15 | 16 | - [Overview](#Overview) 17 | - [Deliverables](#Deliverables) 18 | - [Installation](#Installation) 19 | - [Prerequisites](#Prerequisites) 20 | * [Clone this git repository](#Clone-this-git-repository) 21 | * [Install build dependencies](#Install-build-dependencies) 22 | - [Building Manually](#Building-Manually) 23 | - [Related](#Related) 24 | * [Fabric Manager](#Fabric-Manager) 25 | * [NVIDIA driver](#NVIDIA-driver) 26 | - [See also](#See-also) 27 | * [RPM](#RPM) 28 | - [Contributing](#Contributing) 29 | 30 | 31 | ## Deliverables 32 | 33 | This repo contains the template files used to build the following **DEB** packages: 34 | 35 | 36 | > _note:_ `XXX` is the first `.` delimited field in the driver version, ex: `525` in `525.85.12` 37 | 38 | ```shell 39 | - libnvidia-nscq-XXX 40 | > ex: libnvidia-nscq-525_525.85.12-1_amd64.deb 41 | ``` 42 | 43 | 44 | ## Installation 45 | 46 | * **Debian** 47 | 48 | ```shell 49 | apt-get install libnvidia-nscq-XXX 50 | ``` 51 | 52 | * **Ubuntu** 53 | 54 | ```shell 55 | apt-get install libnvidia-nscq-XXX 56 | ``` 57 | 58 | 59 | ## Prerequisites 60 | 61 | ### Clone this git repository: 62 | 63 | Supported branches as described in the [NVIDIA Datacenter Drivers](https://docs.nvidia.com/datacenter/tesla/drivers/index.html#cuda-drivers) documentation. 64 | 65 | ```shell 66 | git clone https://github.com/NVIDIA/apt-packaging-libnvidia-nscq 67 | ``` 68 | 69 | ### Download a NSCQ tarball: 70 | 71 | * https://developer.download.nvidia.com/compute/nvidia-driver/redist/libnvidia_nscq/ 72 | 73 | *ex:* libnvidia_nscq-linux-x86_64-525.85.12-archive.tar.xz 74 | 75 | ### Install build dependencies 76 | > *note:* these are only needed for building not installation 77 | 78 | ```shell 79 | # objdump 80 | apt-get install binutils 81 | # Packaging 82 | apt-get install debhelper devscripts dpkg-dev 83 | ``` 84 | 85 | 86 | ## Building Manually 87 | 88 | ### Download tarball via redistrib JSON 89 | ```shell 90 | baseURL="https://developer.download.nvidia.com/compute/nvidia-driver/redist" 91 | downloadURL=$(curl -s $baseURL/redistrib_525.85.12.json | \ 92 | jq -r '."libnvidia_nscq" | ."linux-x86_64" | ."relative_path"' | \ 93 | sed "s|^|$baseURL/|") 94 | curl -O $downloadURL 95 | ``` 96 | 97 | ### Create a temp directory 98 | ```shell 99 | cd apt-packaging-libnvidia-nscq 100 | mkdir build 101 | rsync -a debian build/ 102 | ``` 103 | 104 | ### Download and extract tarball 105 | ```shell 106 | tar -C build/ -xf ../libnvidia_nscq*.tar.xz 107 | cd build 108 | mv libnvidia_nscq*/* $PWD 109 | rmdir libnvidia_nscq* 110 | ``` 111 | 112 | ### Check API version 113 | ```shell 114 | find -type l -name "*.so.*" | sort -uVr | awk -F ".so." '{print $2}' | awk NR==1 115 | > 2.0 116 | ``` 117 | 118 | ### Check SONAME 119 | ```shell 120 | objdump -p /dev/stdin < $(find -type f -name "libnvidia-nscq.so.*") | \ 121 | grep SONAME | awk -F ".so." '{print $2}' 122 | > 2 123 | ``` 124 | 125 | ### Fill variables 126 | ```shell 127 | make -f debian/rules fill_templates VERSION=525.85.12 BRANCH=525 DEB_HOST_ARCH=amd64 128 | ``` 129 | > _note:_ branch is the first `.` delimited field in the driver version, ex: `525` in `525.85.12` 130 | 131 | ### Generate .deb packages 132 | ```shell 133 | DEB_BUILD_OPTIONS=nostrip DEB_HOST_ARCH=amd64 \ 134 | dpkg-buildpackage -b -aamd64 135 | cd .. 136 | ls *.deb 137 | ``` 138 | > _note:_ for SBSA (arm64 server), pass `DEB_HOST_ARCH=arm64` and `-aarm64` 139 | 140 | 141 | ## Related 142 | 143 | ### Fabric Manager 144 | 145 | - fabricmanager 146 | * [https://github.com/NVIDIA/apt-packaging-fabric-manager](https://github.com/NVIDIA/apt-packaging-fabric-manager) 147 | 148 | ### NVIDIA driver 149 | 150 | - nvidia-driver 151 | * [https://github.com/NVIDIA/ubuntu-packaging-nvidia-driver](https://github.com/NVIDIA/ubuntu-packaging-nvidia-driver) 152 | 153 | 154 | ## See also 155 | 156 | ### RPM 157 | 158 | * [https://github.com/NVIDIA/yum-packaging-libnvidia-nscq](https://github.com/NVIDIA/yum-packaging-libnvidia-nscq) 159 | 160 | 161 | ## Contributing 162 | 163 | See [CONTRIBUTING.md](CONTRIBUTING.md) 164 | --------------------------------------------------------------------------------