Installing Nsight Compute tool within a DOCKER container

Hello everyone !!!
I would like install Nsight Compute tool and analyze the performance of programs using RAPIDS AI.
I have installed RAPIDS AI using the DOCKER option.
I start running the docker using the following command:-

> docker run --gpus all --rm -it \
>     --shm-size=1g --ulimit memlock=-1 \
>     -p 8888:8888 -p 8787:8787 -p 8786:8786 \
>     rapidsai/rapidsai-core:22.06-cuda11.4-runtime-ubuntu20.04-py3.9

And to install Nsight Compute tool within this Docker Container, I used the following Link:
https://developer.nvidia.com/blog/nvidia-nsight-systems-containers-cloud/

As given in the above link, as I am using RAPIDS AI in a docker container and would like to install Nsight within this container, I created a new Dockerfile within my home/$USER/Docker directory and pasted the following (AS I AM ALREADY USING RAPIDS AI of the following version):

ARG IMAGE=nvcr.io/nvidia/rapidsai/rapidsai-core:22.06-cuda11.4-runtime-ubuntu20.04-py3.9
FROM $IMAGE

NVIDIA Nsight Systems 2020.2.1

RUN apt-get update -y &&
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends
apt-transport-https
ca-certificates
gnupg
wget &&
rm -rf /var/lib/apt/lists/*
RUN wget -qO - https://developer.download.nvidia.com/devtools/repos/ubuntu2004/amd64/nvidia.pub | apt-key add - &&
echo “deb https://developer.download.nvidia.com/devtools/repos/ubuntu2004/amd64/ /” >> /etc/apt/sources.list.d/nsight.list &&
apt-get update -y &&
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends
nsight-systems-2020.2.1 &&
rm -rf /var/lib/apt/lists/*

And run the following command in my terminal:

docker build Docker

//Docker is the directory that has the file Dockerfile

But, I am getting the ERROR:
unauthorized: authentication required

How to rectify/avoid the above error and successfully install Nsight Compute tool within RAPIDS AI docker container?
Also, I am getting the correct output for the command nvidia-smi.
But, getting the error ‘nsys command not found’ for the command nsys status -e (when run within the RAPIDS AI container.

So, I would like to know how to install Nsight Compute tool within a docker container with RAPIDS AI already running in that container ?? (is the Dockerfile I am using (as shown above) correct?)

Note that Nsight Compute and Nsight Systems are two different tools.

I suppose you want to use Nsight Systems. If yes than we can move this post to the Nsight Systems category.

Please refer https://developer.nvidia.com/blog/using-nsight-compute-in-containers/ for Nsight Compute.

Thanks for pointing the 2 different tools. I would like to install Nsight Compute First.

To install Nsight Compute tool within a docker container (in which RAPIDS AI is already running),
I created a Dockerfile within the directory /home/$USER/Docker/Dockerfile.
The Dockerfile contains the following:

ARG IMAGE=nvcr.io/nvidia/rapidsai/rapidsai-core:22.06-cuda11.4-runtime-ubuntu20.04-py3.9
FROM $IMAGE

RUN apt-get update -y &&
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends
apt-transport-https
ca-certificates
gnupg
wget &&
rm -rf /var/lib/apt/lists/*
RUN echo “deb Index of /compute/cuda/repos/ubuntu1804/x86_64 /” > /etc/apt/sources.list.d/cuda.list &&
wget -qO - https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | apt-key add - &&
apt-get update -y &&
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends
nsight-compute-2022.2.0 &&
rm -rf /var/lib/apt/lists/*

When I run,

docker build Docker
I am getting the ERROR: (same error as i got for Nsight Systems)
unauthorized: authentication required

This appears to be a docker setup issue & not related to Nsight Compute. Please search for information related to this error " unauthorized: authentication required". Here is one related stack overflow post I found docker unauthorized: authentication required - upon push with successful login - Stack Overflow

Also note that Nsight Compute is appropriate if you want to do detailed analysis of a CUDA kernel.

Nsight Systems is the suggested tool to use first for overall application level analysis.

Hello,

As stated previously, you might be searching for Nsight Systems and not Nsight Compute.

That being said, I think there are two issues with your Dockerfile that need to be fixed for the container image to build.

  • Base image name

I think there might be a mistake in the name of the base image you are trying to use to build your container image.

When a request to pull a container image is made to a registry and that request fails, the local client can’t really know if the pull failed because the image didn’t exist or if it is because of an authentication issue in order to keep the existence of private images secret.

You can verify this by trying to run this which should yield the authentication error:

$ docker pull nvcr.io/image/does/not/exist

I tried pulling the image you used and my container engine can’t seem to find it but it can find the following image (same as yours but without the -core).

$ docker pull nvcr.io/nvidia/rapidsai/rapidsai:22.06-cuda11.4-runtime-ubuntu20.04-py3.9

This image is documented here.

  • Repository URL for your package manager

Also, I think you may have forgotten to replace the string Index of /compute/cuda/repos/ubuntu1804/x86_64 by the actual URL for the repository which (since you use Ubuntu 22.04 for your base image) should be https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64. You will also want to change the ubuntu1804 to ubuntu2004 in the URL given to wget to get the key for Ubuntu 20.04 and not 18.04.

With those two fixes, the image builds fine. The resulting Dockerfile would look like this:

ARG IMAGE=nvcr.io/nvidia/rapidsai/rapidsai:22.06-cuda11.4-runtime-ubuntu20.04-py3.9
FROM $IMAGE

RUN apt-get update -y && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        apt-transport-https \
        ca-certificates \
        gnupg \
        wget && \
    rm -rf /var/lib/apt/lists/*

RUN echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \
    wget -qO - https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub | apt-key add - && \
    apt-get update -y && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nsight-compute-2022.2.0 && \
    rm -rf /var/lib/apt/lists/*
1 Like

Thanks a lot!! After making these 2 changes, I was successfully able to get the docker image. (& used docker run to get the container with both RAPIDS AI and Nsight Systems working).

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.