Can't get cuda and nvidia combination works

I have two nvidia GPUs and one iGPU (intel). One of the nvidia GPUs is an eGPU connected to my laptop through thunderport. From my previous thread, to get the eGPU works I need an open version of the driver.

The cuda versions that are compatible with ubuntu 22.04 are 11.7, 11.7.1, 11.8, 12.0, and 12.1. so the problem is non of them support open nvidia driver. Cuda always installs its own version even if I have the nvidia driver installed.
Even worse, when I try to install nvidia-cuda-toolkit, it says it is going to remove the current cuda and nvidia driver installed.
Any solution to that?

Don’t use nvidia-cuda-toolkit, that’s ubuntu packaged with sometimes weird dependencies.
Just use the cuda repo but don’t install the bundled driver by using the “cuda-toolkit” metapackage instead of the “cuda” metapackage. e.g.
sudo apt install cuda-toolkit
or, for a specific version
sudo apt install cuda-toolkit-11-7
this will leave the already installed driver untouched.

Thank you, it seems to be working correctly. Here is what I did:
sudo add-apt-repository "deb /"
sudo apt install cuda-toolkit
Add cuda to the system path
echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> ~/.bashrc
nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Feb__7_19:32:13_PST_2023
Cuda compilation tools, release 12.1, V12.1.66
Build cuda_12.1.r12.1/compiler.32415258_0

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