在 Google Colab 上使用 Nsight Compute 时遇到问题:ncu 出现“找不到命令”错误,Nsight Compute 出现安装脚本错误

问题描述 投票:0回答:1

我正在尝试在 Colab 上使用 ncu,但是当我输入

ncu
/bin/bash: ncu: command not found

几天前这个命令运行良好,我不确定是我在代码中犯了一些错误还是 colab 的问题。

我无法安装 Nsight,因为如果我运行这个:

!chmod +x  /content/drive/MyDrive/ncu/nsight-compute-Linux-2023.1.0.16-32451174.run
!/content/drive/MyDrive/ncu/nsight-compute-Linux-2023.1.0.16-32451174.run  --confirm

它显示在许可证之后它出现了这个错误

The program './install-Linux.pl' returned an error code (1)

因为这个错误我不能使用 nvprof(新架构不再支持 nvprof)

======== Warning: Skipping profiling on device 0 since profiling is not supported on devices with compute capability 7.5 and higher.
                  Use NVIDIA Nsight Compute for GPU profiling and NVIDIA Nsight Systems for GPU tracing and CPU sampling.
                  Refer https://developer.nvidia.com/tools-overview for more details.
cuda google-colaboratory nsight
1个回答
0
投票

以下是在 Google Colab 上安装 CUDA Toolkit 12.1 的说明,其中包括 Nsight Compute:

  1. 从 NVIDIA 的安装程序下载并安装 CUDA 12.1
! set -x \
&& cd $(mktemp -d) \
&& wget https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda_12.1.0_530.30.02_linux.run \
&& sudo sh cuda_12.1.0_530.30.02_linux.run --silent --toolkit \
&& rm cuda_12.1.0_530.30.02_linux.run
  1. 将 CUDA 二进制文件夹添加到
    PATH
import os
os.environ['PATH'] = os.environ['PATH'] + ':/usr/local/cuda/bin/'
  1. 运行 Nsight 计算!
! ncu --version

随意克隆我现有的 Google Colab 笔记本在这里

© www.soinside.com 2019 - 2024. All rights reserved.