Can't Open Nsight Systems 2020.4.2

I installed cuda10.2, nsight-systems 2020.4.2 and etc. on the host PC with SDK Manager 1.3.1.7110. Then, I tried to open nsight-sys, but I got the following error.

$ nsight-sys 
Error: Nsight Systems 2019.5.2 hasn't been installed with CUDA Toolkit 10.2

The problem is /usr/local/cuda-10.2/bin/nsight-sys is looking for nsight-systems 2019.5.2, but what’s actually installed is nsight-systems 2020.4.2. My question is how to make /usr/local/cuda-10.2/bin/nsight-sys look for nsight-systems 2020.4.2.

$ which nsight-sys    
/usr/local/cuda-10.2/bin/nsight-sys
$ cat /usr/local/cuda-10.2/bin/nsight-sys 
#!/bin/bash

shopt -s execfail
try_exec() {
    if [[ -x "$1" ]]; then
        exec "$@"
    fi
}

DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
CUDA_INSTALL_DIR=$(cd "$DIR/.." && pwd)
try_exec "$CUDA_INSTALL_DIR"/nsight-systems-2019.5.2/host-linux-x64/nsight-sys "$@"
try_exec /opt/nvidia/nsight-systems/2019.5.2/host-linux-x64/nsight-sys "$@"

echo "Error: Nsight Systems 2019.5.2 hasn't been installed with CUDA Toolkit 10.2" >&2
exit 1
$ ls /opt/nvidia/nsight-systems 
2020.4.2/

Host
OS: Ubuntu 18.04
CUDA: 10.2 (installed with SDK manager 1.3.1.7110)
Nsight Systems: 2020.4.2 (installed with SDK manager 1.3.1.7110)

It worked for now.

$ exec /opt/nvidia/nsight-systems/2020.4.2/host-linux-x64/nsys-ui
1 Like