# Learning Riva ## Setup Pre-reqs Get NGC setup with `ngc-cli` or `docker`. After logging into https://ngc.nvidia.com/ go to Profile > Setup to get the cli and API KEY. On my Orin I installed the ngc-cli to /opt/nvida/ngc-cli with a symlink into /usr/local/bin. Or with docker: ``` docker login nvcr.io Username: $oauthtoken Password: YOUR API KEY ``` ## Nvidia Docker on Ubuntu 22.04 We need the Nvidia container toolkit for GPU docker integration. [The Docker Utility Engine for NVIDIA GPUs](https://docs.nvidia.com/ai-enterprise/deployment-guide/dg-docker.html) install the nvidia-container-toolkit. This should allow you to run a sample gpu enabled container like: First check you Cuda driver using `nvidia-smi` on the host, then check the docker environment: ``` docker run --rm --gpus all nvidia/cuda:11.0.3-base-ubuntu20.04 nvidia-smi ``` This resulted in an error because I didn't have cuda drivers installed. See next if this is the case for you. ### Nvidia Driver Installation Since I didn't have an `nvida-smi` binary I didn't have the Nvidia Driver installed for use with Cuda. Following the Quickstart guide for nvidia driver install https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html#ubuntu-lts. I had some conflicts, which simply required updating `nvidia-kernel-source-515` and `nvidia-kernel-common-515`. I could then: ``` sudo apt-get -y install cuda-drivers ``` Which required a reboot: ``` ... A modprobe blacklist file has been created at /etc/modprobe.d to prevent Nouveau from loading. This can be reverted by deleting the following file: /etc/modprobe.d/nvidia-graphics-drivers.conf A new initrd image has also been created. To revert, please regenerate your initrd by running the following command after deleting the modprobe.d file: `/usr/sbin/initramfs -u` ***************************************************************************** *** Reboot your computer and verify that the NVIDIA graphics driver can *** *** be loaded. *** ********************* ... ``` After reboot `nvidia-smi` displays the cuda driver info ``` un Nov 13 10:54:34 2022 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 520.61.05 Driver Version: 520.61.05 CUDA Version: 11.8 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA GeForce ... On | 00000000:09:00.0 On | N/A | | 35% 36C P8 21W / 350W | 594MiB / 12288MiB | 2% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | 0 N/A N/A 2077 G /usr/lib/xorg/Xorg 316MiB | | 0 N/A N/A 2336 G /usr/bin/gnome-shell 145MiB | | 0 N/A N/A 3432 G ...7/usr/lib/firefox/firefox 131MiB | +-----------------------------------------------------------------------------+ ``` I can also see I can run the Docker Container now: ``` docker run --rm --gpus all nvidia/cuda:11.0.3-base-ubuntu20.04 nvidia-smi Sun Nov 13 15:55:57 2022 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 520.61.05 Driver Version: 520.61.05 CUDA Version: 11.8 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA GeForce ... On | 00000000:09:00.0 On | N/A | | 0% 36C P8 19W / 350W | 593MiB / 12288MiB | 0% Default | | | | N/A | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| +-----------------------------------------------------------------------------+ ``` ### Additional Audio Testing I downloaded the Audacity tool which comes as an AppImage. This requires the [FUSE (Filesystem in user space)](https://github.com/AppImage/AppImageKit/wiki/FUSE) setup which is installable from the universe repo with: ``` sudo apt install libfuse2 ``` ## Actual Riva Setup Following the quick-start guide https://resources.nvidia.com/en-us-riva-asr-briefcase/quick-start-guide directed me to the AMD64 or ARM64 utility scripts )https://catalog.ngc.nvidia.com/orgs/nvidia/teams/riva/resources/riva_quickstart/files?version=2.7.0. Using the Download and CLI option ``` ngc registry resource download-version "nvidia/riva/riva_quickstart:2.7.0" ``` This downloads the quickstart scripts to my local directory. I have excluded these from this repo since they are version and platform dependent. I was content with the default settings of the `config.sh`, so I simply