So I've been stumped on this for a while now. I've been trying to make my AMD the primary GPU but still be able to use my Nvidia GPU for other tasks. Passthrough is possible as the device still shows up in lspci as it seems sudo prime-select intel
only disable nvidia drivers but I need those drivers if I want to hope to offload PhysX to my GTX 650.
Trying to use DRI_PRIME=1
or PrefersNonDefaultGPU=true
leads to unusual and buggy behaviour. Like I got Mirror's Edge running but it was incredibly slow so I've come to conclusion that I need to some how make my GPU's switch order.
I would take out my GPU's and switch them around but my AMD RX 6800 GPU is stuck in their good and I'm not looking forward to the day I go to take it out so I'm not gonna mess with that as I've already had a ton of issues getting that GPU to work properly in the past. I know the driver isn't loading because I get this from nvidia-smi.
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
So I can load the Nvidia drivers again by setting it to sudo prime-select nvidia
and rebooting my system. It's just a matter of figuring out how to get The Nvidia card and the AMD card to switch places in GPU order. I asked here earlier and while it gets rid of the buggy issues it also prevents me from using that Nvidia card for PhysX offloading.
https://forum.zorin.com/t/how-can-i-make-my-amd-gpu-the-primary-gpu/45325
My GPU's show up in lspci like this if this info helps at all.
04:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)
0b:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] (rev c3)
Using Brave A.I. Search engine using the search terminology of "How to get AMD GPU and Nvidia GPU working concurrently in Ubuntu 22.04" (Zorin 17 is based on Ubuntu 22.04) gives:
Accessing Multiple GPUs on Ubuntu
To access both AMD GPU and Nvidia GPU concurrently in Ubuntu 22.04, you need to carefully configure the X-server. One method involves editing the /etc/X11/xorg.conf
file to specify the devices and their respective drivers. Here is an example configuration:
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusId "PCI:2@0:0:0" # Identifier taken from lspci output
EndSection
Section "Device"
Identifier "Device1"
Driver "amdgpu"
BusId "PCI:1@0:0:0" # Identifier taken from lspci output
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device1" # This identifier should be from the GPU device connected to display (in this case, AMD card)
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
This configuration specifies the AMD GPU for display purposes and the Nvidia GPU for other tasks like CUDA or OpenCL. Ensure that the BusId
values are correctly identified from the output of lspci | egrep -h "VGA|3D controller"
command.
Additionally, you might need to install the necessary drivers for both GPUs. For Nvidia, you can use ubuntu-drivers autoinstall
or manually install specific versions like nvidia-driver-455
if needed.
If you encounter issues, consider removing and reinstalling the Nvidia drivers to resolve any conflicts.
AI-generated answer
I gave that Xorg stuff a good even though I figured it might not work or worse cause some severe system issues (actually froze Zorin once with a bad config) but in the end it really didn't accomplish anything. Oh I even went as far as to rearrange my GPU's even though getting the AMD RX 6800 was just having none of it and I have to shimmy the switch with a plastic twist tie to get it out as it was jammed in there good. Sadly swapping the GPU's physical positions had no effect on their GPU order.
Other than that I did figure out how to get the driver working without sacrificing my AMD GPU's spot as primary. sudo prime-select intel
does something in /lib/modprobe.d
where it adds a blacklist for nvidia. I also came across this annoying thing which is why my Nvidia GPU kept trying to be first. So running these two commands I removed them and now the driver is active but it doesn't render anything which is great.
sudo rm /lib/modprobe.d/blacklist-nvidia.conf
sudo rm /lib/modprobe.d/nvidia-kms.conf
I still have no idea how to use the Nvidia GPU on a process though. It's running in compute mode so now it's just a matter of getting it to work with Mirror's Edge.
Mon Mar 17 22:45:08 2025
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.256.02 Driver Version: 470.256.02 CUDA Version: 11.4 |
|-------------------------------+----------------------+----------------------+
| 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 ... Off | 00000000:0B:00.0 N/A | N/A |
| 40% 34C P8 N/A / N/A | 6MiB / 981MiB | N/A Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
I did try using export PHYSX_GPU_DEVICE="1"
before running Steam but whenever I go to launch Mirror's Edge it just crashes and says something about failing to find the primary display adapter.
So I found out all my work was pointless. Linux didn't get PhysX GPU acceleration until Physics SDK 3.3.2 as mentioned here.
https://news.softpedia.com/news/NVIDIA-Brings-GPU-Acceleration-Support-for-PhysX-on-Linux-461924.shtml
By the time that SDK was around GPU accelerated PhysX kinda became irrelevant as it ran decently on CPU's. Well this was a massive waste of time.