update-alternatives --display cuda missing a specific version

本文指导如何在系统中手动添加CUDA11.8到update-alternatives系统,以便轻松切换不同版本,包括安装验证、添加步骤、检查及切换过程。
摘要由CSDN通过智能技术生成

It looks like you want to manage different versions of CUDA on your system using update-alternatives, which is a smart way to easily switch between them. However, since CUDA 11.8 is not appearing in your list of alternatives, you’ll need to add it manually. Here’s how you can do it:

  1. First, verify that CUDA 11.8 is indeed installed at /usr/local/cuda-11.8. You should see a directory structure similar to other CUDA versions if it’s correctly installed.

  2. Use the update-alternatives command to add CUDA 11.8 to the alternatives system. We’ll assign it a priority; based on your existing priorities, we can use 118 for CUDA 11.8. You can adjust the priority if needed. Open a terminal and type the following command:

    sudo update-alternatives --install /usr/local/cuda cuda /usr/local/cuda-11.8 118
    

    This command breaks down as follows:

    • --install: Command to add an alternative.
    • /usr/local/cuda: The generic name for the master link.
    • cuda: The name of the alternative link group.
    • /usr/local/cuda-11.8: The path to the actual CUDA 11.8 installation.
    • 118: The priority assigned to this version.
  3. After adding CUDA 11.8 to the alternatives, you can check if it has been added successfully by running:

    sudo update-alternatives --display cuda
    

    You should now see CUDA 11.8 in the list.

  4. If you want to switch to CUDA 11.8, you can use the following command:

    sudo update-alternatives --config cuda
    

    This will prompt you with a list of all installed CUDA versions. You can select the number corresponding to CUDA 11.8 to switch to it.

  5. Verify that the switch was successful by checking the symlink:

    ls -l /usr/local/cuda
    

    This should show that /usr/local/cuda points to /usr/local/cuda-11.8.

Following these steps will allow you to manage and switch between different CUDA versions easily using the update-alternatives utility.

  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值