Score:0

how do I delete symbolic link to Cuda 12 so I can install multiple versions and swtich between them using a simple bash script?

ph flag

https://notesbyair.github.io/blog/cs/2020-05-26-installing-multiple-versions-of-cuda-cudnn/

I already have Cuda on my WSL2:

@LAPTOP-DNCQ5AAC:/mnt/d/ai/llm/ng-video-lecture$ nvidia-smi
Sun Aug 13 16:22:37 2023
+---------------------------------------------+
| NVIDIA-SMI 525.116      Driver Version: 528.96       CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0 Off |                  N/A |
| N/A   42C    P8     2W /  50W |      9MiB /  4096MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+---------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A       213      G   /Xwayland                       N/A      |
+---------------------------------------------+
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0

I am pretty sure I said "yes" to creating a symbolic link during installation.

Now to follow that blog at the url I posted above, how do I get rid of my Cuda symbolic link?

I need to install Cuda version 11.8 or 11.7 because I want to run PyTorch C++ on Cuda and they don't have a Cuda 12 version.

I found a command

@LAPTOP-DNCQ5AAC:/mnt/d/ai/llm/ng-video-lecture$ sudo find / -type l | grep libcuda
/home/nobu/miniconda3/envs/rapids-23.04/lib/libcudart.so.11.0
/home/nobu/miniconda3/envs/rapids-23.04/lib/libcudart.so
/home/nobu/miniconda3/envs/ldm/lib/libcudart.so.11.0
/home/nobu/miniconda3/envs/ldm/lib/libcudart.so
/home/nobu/miniconda3/envs/tf/lib/libcudart.so.11.0
/home/nobu/miniconda3/envs/tf/lib/libcudart.so
/home/nobu/miniconda3/envs/paddleocr/lib/libcudart.so.10.2
/home/nobu/miniconda3/envs/paddleocr/lib/libcudart.so
/home/nobu/miniconda3/envs/vision_transformer/lib/libcudart.so.11.0
/home/nobu/miniconda3/envs/vision_transformer/lib/libcudart.so
/home/nobu/miniconda3/envs/pytorch/lib/libcudart.so.11.0
/home/nobu/miniconda3/envs/pytorch/lib/libcudart.so
/home/nobu/miniconda3/envs/open-mmlab/lib/libcudart.so.11.0
/home/nobu/miniconda3/envs/open-mmlab/lib/libcudart.so
/home/nobu/miniconda3/pkgs/cudatoolkit-11.1.1-hb139c0e_12/lib/libcudart.so.11.0
/home/nobu/miniconda3/pkgs/cudatoolkit-11.1.1-hb139c0e_12/lib/libcudart.so
/home/nobu/miniconda3/pkgs/cudatoolkit-11.3.1-h2bc3f7f_2/lib/libcudart.so.11.0
/home/nobu/miniconda3/pkgs/cudatoolkit-11.3.1-h2bc3f7f_2/lib/libcudart.so
/home/nobu/miniconda3/pkgs/cudatoolkit-10.2.89-hfd86e86_1/lib/libcudart.so.10.2
/home/nobu/miniconda3/pkgs/cudatoolkit-10.2.89-hfd86e86_1/lib/libcudart.so
/home/nobu/miniconda3/pkgs/cudatoolkit-11.2.2-hbe64b41_11/lib/libcudart.so.11.0
/home/nobu/miniconda3/pkgs/cudatoolkit-11.2.2-hbe64b41_11/lib/libcudart.so
/home/nobu/miniconda3/pkgs/cudatoolkit-11.8.0-h37601d7_11/lib/libcudart.so.11.0
/home/nobu/miniconda3/pkgs/cudatoolkit-11.8.0-h37601d7_11/lib/libcudart.so
find: File system loop detected; ‘/mnt/wslg/distro’ is part of the same file system loop as ‘/’.
find: ‘/mnt/d/$RECYCLE.BIN/S-1-5-21-2207593063-2945772590-794792826-1001’: Permission denied

What's happening at the end there?

Edit: Thanks to @chan for advice on using multiple cudas.

I read this to install 11.8

How do I install NVIDIA and CUDA drivers into Ubuntu?

so basically at the installation menu I can skip the drivers but right now when I select Driver Options in that menu, I get a blank bash:

blank bash

cc flag
Take a look at https://askubuntu.com/questions/1219761/cuda-10-2-different-installation-paths/1244010#1244010 for installing multiple CUDA versions.
Score:0
za flag

It's been a while since I played with CUDA but in my workstaion, I have in .bashrc

export CUDA_HOME=${CUDA_HOME}:/usr/local/cuda
export CUDA_PATH=/usr/local/cuda

and

$ls /usr/local/cuda*
cuda/      cuda-11/   cuda-11.3/
$ ls /usr/local/cuda -l
lrwxrwxrwx 1 root root 22  Jun 10  2021 /usr/local/cuda -> /etc/alternatives/cuda
$ ls -l /etc/alternatives/cuda
lrwxrwxrwx 1 root root 20  Jun 10  2021 /etc/alternatives/cuda -> /usr/local/cuda-11.3

so you can install may CUDA versions under /usr/local and use update-alternative command to set the default version. For example after you install another version, you do update=alternatives -config cuda to set the version you want as the default from the listed versions. Please do man update-alternatives to see how to use it(use with sudo ). (I guess the install script already did update-alternative --install cuda for the new installed version, so it will appear in the update-alternatives --list command.)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.