How can I obtain the GPG pubkey when adding nvidia repository?

Hi,
I have an issue installing nvidia hpc sdk. The tutorial provided by nvhpc is useful and I succesfully installed it on my own pc.
But I failed installing the hpc sdk on the workstation. The error message is “no valid opengpg data found”, or when I try “apt-get update”, the repository is not updating and shows “the following signatures couldn’t be verified because the public key is not available: NO_PUBKEY”
Both pc and workstation are running ubuntu 18.04 and I am using a docker.

Did you follow all the instructions on the download page? The error message implies that you did not add the HPC SDK public key to your keyring. I.e. this line didn’t get run on the workstation system:

% curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg

Thanks, jmudd.

Yes I followed the instructions on the download page.
for piped commands, I can see the ETA shown fetching the gpg keyring. but after usually 3~10 seconds, it will show the error message “no valid opengpg data found”
for individual runs, “curl” completes but “sudo gpg” is not giving any echo, the file “/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg” is created but nothing is written in this file.

The empty keyring file implies that the public key could not be downloaded, so I would break the curl command into pieces:

curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK > /tmp/DEB-GPG-KEY-NVIDIA-HPC-SDK

more /tmp/DEB-GPG-KEY-NVIDIA-HPC-SDK

cat /tmp/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg

Thanks jmudd,

Again, the file “/tmp/DEB-GPG-KEY-NVIDIA-HPC-SDK” was created but the file is empty.
I think this might be the problem of network or something.
Anyway, I managed to install nvhpc with the universal way, wget the tarball, untar, install.

Hi, I was able to install HPC-SDK in machines I have root right. However, when I was trying to install HPC-SDK in conda environment where I does not have root permit and cannot use sudo, I have the following informations:

(studiolab) studio-lab-user@default:~/FDS_GPU_PUBLISH/scripts$ curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | gpg --dearmor -o /home/studio-lab-user/keyrings/nvidia-hpcsdk-archive-keyring.gpg
File ‘/home/studio-lab-user/keyrings/nvidia-hpcsdk-archive-keyring.gpg’ exists. Overwrite? (y/N) % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1626 100 1626 0 0 29563 0 --:–:-- --:–:-- --:–:-- 30111
y
(studiolab) studio-lab-user@default:~/FDS_GPU_PUBLISH/scripts$ echo ‘deb [signed-by=/home/studio-lab-user/keyrings/nvidia-hpcsdk-archive-keyring.gpg] Index of /hpc-sdk/ubuntu/amd64 /’ | tee /home/studio-lab-user/sources.list.d/nvhpc.list
deb [signed-by=/home/studio-lab-user/keyrings/nvidia-hpcsdk-archive-keyring.gpg] Index of /hpc-sdk/ubuntu/amd64 /
(studiolab) studio-lab-user@default:~/FDS_GPU_PUBLISH/scripts$ conda install nvhpc-23-7 -c nvidia
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  • nvhpc-23-7

Current channels:

To search for alternate channels that may provide the conda package you’re
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

How can I install it under conda environment? thanks.

I really can’t speak to why the downloaded GPG key file is empty. I can think of a variety of causes.

In the example above, make sure that " Index of /hpc-sdk/ubuntu/amd64" above is really just

https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64

I think that’s just an artifact of the user forum software but let’s make sure. It would be best if you’d use the </> icon to include preformatted text.

We have not had a reason to rotate the NVHPC signing keys so you shouldn’t need to create a new one if you know the old works. I only mention that because you’ve had issues with the key in the past.

The nvhpc-23-7 package does exist so perhaps your installation line is not correct? I am not familiar for the conda enviroment so I’m not sure there.

Thank you, I think the issue here is how to install HPC-SDK under conda environment? are there anyone who have survived this? thanks.