Changing your Graphics Card from Nvidia Proprietary Drivers to AMD Proprietary Drivers

I am now in the throes of upgrading my video card on my main Desktop machine. It's running Debian 10 ("Buster") with a KDE "Plasma" desktop, connected over a DVI-1 socket through a VGA adapter to a flat-screen monitor ganked from someone's trash pile.

I spent around $135 on a spiffy cool AMD Radeon RX 570 on sale at my Friendly Local Computer Store (FLCS). I'm hoping to harness some of this awesome compute power for OpenCV and perhaps even Folding at Home. I've already started playing with OpenGL courtesy of this excellent tutorial, which has been most interesting and fun. Plus it's given me a chance to exercise my C (not C++!) chops..

So my first problemo was that I was running the proprietary Nvidia drivers for my current $70 video card, which according to lspci is:

04:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 610] (rev a1)

The proprietary drivers were in the nvidia-legacy-390xx-driver package. Since the new card is an AMD, I very much doubted that the nvidia proprietary drivers would even allow me to bring up the desktop. I wanted to drop back to the shipped Nouveau drivers to make sure everything would work before I installed the (still proprietary) AMD drivers.

So here's what I wound up doing:

<ctl><alt>F4 to a terminal session
# Login as root
# Drop to multi-user: network connected, but no graphical desktop
systemctl isolate multi-user.target
# Uninstall the proprietary nvidia drivers
apt-get uninstall  nvidia-legacy-390xx-driver package.
# Make sure nvidia stuff is really uninstalled.
cd /etc/modprobe.d
mv nvidia-blacklists-nouveau.conf nvidia-blacklists-nouveau.conf.backup 
mv nvidia.conf nvidia.conf.backup 
mv nvidia-kernel-common.conf nvidia-kernel-common.conf.backup
# Reinstall nouveau packages 
# nb that "drm" here means "Direct Rendering Manager"
apt-get install --reinstall libdrm-nouveau2
apt-get install --reinstall xserver-xorg-nouveau
# Bring graphical desktop back up
systemctl isolate graphical.target
# Reboot system
# Verify that nouveau drivers are loaded
su
lsmod | grep nouveau
nouveau              2179072  31
video                  45056  1 nouveau
ttm                   131072  1 nouveau
drm_kms_helper        208896  1 nouveau
drm                   495616  24 drm_kms_helper,ttm,nouveau
i2c_algo_bit           16384  1 nouveau
mxm_wmi                16384  1 nouveau
wmi                    28672  2 mxm_wmi,nouveau
button                 16384  1 nouveau

Then I took my machine to basement laboratory and wrangled hardware. Made another visit to my FLCS after I found out that DVI-1 and DVI-D are Different; the older DVI-1 connector has analog-out pins which the newer one lacks. DVI-D to VGA adapters are both expensive and rare. I wound up connecting through one of the three DisplayPort sockets on the 570 with an $8.99 adapter. Too late I noticed that it also has an HDMI connector; that would probably be the Optimal Solution. I haven't (yet) experimented with multiple monitors. That awaits another lucky trash day.

On first boot, she kvetched about missing firmware. But the desktop came up ok fine, albeit with no desktop Effects ( I have Rotating Cube turned on for switching desktops)

# Login as root again
# Drop back down to multi-user:
 
systemctl isolate multi-user

Go through the apt commands in this excellent explainer

Rebooted

#Verify that amd drivers are loaded
lsmod | grep amd
amdkfd                237568  1
amdgpu               3461120  32
chash                  16384  1 amdgpu
gpu_sched              28672  1 amdgpu
i2c_algo_bit           16384  1 amdgpu
ttm                   131072  1 amdgpu
drm_kms_helper        208896  1 amdgpu
drm                   495616  25 gpu_sched,drm_kms_helper,amdgpu,ttm
mfd_core               16384  2 lpc_ich,amdgpu

# Take a look at lspci
lspci | grep VGA
04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480] (rev ef)

#glxinfo also has something to say:
glxinfo | grep Device
    Device: Radeon RX 570 Series (POLARIS10, DRM 3.27.0, 4.19.0-9-amd64, LLVM 7.0.1) (0x67df)

I then had some additional fumbling around to get my openGL tutorials working again. They were failing on the GLFW initialize. I found that glxinfo(1) was also failing, claiming it couldn't init GLX properly. After some random duck-duck-go ing I found that my problem was the openGL eXtensions. The final clue was that the nvidia drivers replace libgl.so.0 with a proprietary version. I installed libgl1 ("vendor-neutral GL dispatch library") and rebooted. At that point, both glxinfo(1) and my tutorials started working again. Phew!

The machine is now just marginally noisier than she was with the old card -- this one has two fans in it, so I am up to around 7 fans total in her. But I am all set to explore the Joys of 32 Compute Units, 2048 Stream Processors, and 128 Texture Units!