Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Configuring AMD GPUs for multi-GPU AI workloads on Linux requires matching the GPU, kernel, amdgpu driver, ROCm release and framework versions, then validating the PCIe topology before you run a model. The reliable path is to place cards in CPU-connected slots, install the Radeon-supported ROCm stack, verify every device with rocminfo or amd-smi, select GPUs explicitly, and use PyTorch DistributedDataParallel or carefully controlled inference placement.
What do you need before installing ROCm?
Start with the exact Radeon or Radeon AI PRO model, your Linux distribution and kernel version, and the framework version you intend to use. ROCm support is not universal across every AMD GPU or every distribution release: use AMD’s Linux quick-start matrix and the Radeon/Ryzen documentation for graphics workloads. The generic Instinct installation path is not a substitute for checking the Radeon support matrix.
Prepare a 64-bit Linux installation, administrative access, matching kernel headers, sufficient disk space for ROCm and model files, and a power supply sized for all graphics cards plus the CPU, drives, fans and other peripherals. Plan cooling before software installation; two cards can exhaust substantially more heat than a single-card workstation.
How should two or more AMD GPUs be installed physically?
Use motherboard slots connected directly to the CPU whenever possible. AMD recommends multiple x16-class Gen4 slots and an approximately 1:1 relationship between x16 slots and GPUs for optimal performance. A system can function with fewer lanes, but reduced bandwidth can limit peer transfers and collective operations.
Popular on Amazon
- 【90 Degree Full Function USB C Adapter】Supports the latest USB4 standard for up to 40Gbps of bandwidth, 8K video support, and up to 240W Fast charging; Support USB PD 3.1 Extended Power Range (EPR) including 140W, 180W and 240W. Your productivity is easily doubled. *Warm Tip: For the best fit, please make sure the USB-C port is fully exposed; thick or bulky cases may affect compatibility.
- 【Reliable Quality】Made from high-quality, scratch-resistant aluminum alloy, delicate metal frame. get excellent wear resistance and heat dissipation. Non-Slip Design for easier insertion and removal.
- 【Small and portable】Ultra thin size, ultra compact design, a petite physique that matches the minimalist design of your modern laptops. Coming with a slim figure that won't block the port next to the one it's plugged into.
- 【Compatibility】Widely work with most usb c, thunderbolt 4/3 devices. Compatibilit for ROG Ally, Steam Deck, Switch, MacBook Pro, Quest 3 VR headset, Surface Book 2, iPhone 18/17/16/15, Samsung Galaxy S23/S22/S21, Note 20/10, Google Pixel, ChromeBook, etc.
- 【Excellence Customer Support】If you experience any issues or cable failure, simply reach out to our dedicated customer service team. We provide a prompt response within 18 hours, providing you with the necessary technical support to resolve any concerns.
Use matching electrical configurations
For a two-GPU build, place both cards in CPU-connected slots with the same electrical lane width, or configure motherboard bifurcation so the slots expose equivalent lanes. Avoid putting one card in a chipset-connected slot while the other uses a CPU root port. AMD documents a failure case with two Radeon 7900 XTX cards where a card in a chipset slot produced HIP “operation cannot be performed in the present state”; moving both cards to matching CPU-connected slots resolves that class of topology problem. See AMD’s Radeon multi-GPU guidance.
Check PCIe atomics and IOMMU behavior
ROCm relies on platform atomic operations for HSA queue updates, signals and synchronization. The endpoints, upstream bridges, switches and root ports in the path must support and correctly route PCIe atomics. A slot that appears electrically compatible can still fail if a bridge drops atomic requests; AMD explains the required path in its PCIe atomics documentation.
Enable the IOMMU in firmware when your platform requires it, and use the troubleshooting procedure below if a workload hangs. Keep BIOS settings, lane bifurcation and firmware consistent across the cards. Leave physical space between cards where possible, because a card pressed against another intake can throttle or reset under sustained load.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchAccount for desktop-versus-compute limits
AMD cautions that Radeon GPUs do not support large amounts of simultaneous, parallel workloads. A Linux desktop compositor, display rendering, machine-learning jobs and Blender or other HIP applications can compete for the same resources and trigger resets. For dependable long runs, use a headless system or reserve one GPU for display and reduce the number of concurrent compute jobs. AMD recommends no more than two simultaneous compute workloads when a Linux desktop is active.
How do you install the amdgpu driver and ROCm?
Register the repository for your exact distribution and install the release listed as compatible with your GPU. AMD’s current quick-start supports Ubuntu 22.04 and 24.04, Debian 12 and 13, RHEL 8–10, Oracle Linux, SLES 15.7 and Rocky Linux, but repository package names and supported kernels differ by release. Follow the distribution-specific commands in the quick-start guide rather than copying a repository intended for another OS.
- Update package metadata and install matching headers. On Ubuntu, the documented pattern is:
sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)" - Install the DKMS driver.
sudo apt install amdgpu-dkmsAllow DKMS to build against the running kernel. If Secure Boot is enabled, enroll or sign the DKMS module as required by your distribution.
- Install Python packaging prerequisites when your framework setup needs them.
sudo apt install python3-setuptools python3-wheel - Install ROCm from the registered repository.
sudo apt install rocmPin the ROCm release to the one supported by your GPU and PyTorch build; do not assume that the newest package is compatible.
- Grant device access to your account.
sudo usermod -a -G render,video $LOGNAMELog out and back in, or reboot, so the new group memberships take effect.
- Reboot. This loads the new kernel module and applies group, firmware and device-node changes.
On non-Ubuntu distributions, use the corresponding repository and package commands in AMD’s quick-start. Installing a driver package without the matching kernel headers, or mixing amdgpu and ROCm releases from different support branches, is a common cause of missing devices.
Also popular on Amazon
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
How can you verify that every GPU is visible?
Verify the host before installing model code. Run:
rocminfo
amd-smi
rocminfo should enumerate the HSA agents, while amd-smi reports the installed GPUs and their state. If neither command returns a device, check that the amdgpu module is loaded and not denylisted, confirm that your account belongs to both video and render, and inspect Secure Boot signing for amdgpu-dkms. AMD’s installation FAQ covers these failure modes.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Run the commands once as the normal workload user, not only with sudo. A root-only success can hide incorrect group permissions. Record the device order shown by the tools; that order is what visibility variables and many frameworks use unless you provide an explicit mapping.
How do you select specific AMD GPUs?
For trusted processes, set visibility before the runtime initializes. The following example exposes devices 0 and 1:
export ROCR_VISIBLE_DEVICES="0,1" # ROCm software runtime
export HIP_VISIBLE_DEVICES="0,1" # HIP applications
export GPU_DEVICE_ORDINAL="0,1" # HIP/OpenCL through ROCclr
export CUDA_VISIBLE_DEVICES="0,1" # CUDA-compatible selection on AMD HIP
Use the variable appropriate to the layer your application uses; setting all four can make scripts portable across ROCm, HIP, ROCclr and CUDA-compatible code paths. Set them in the shell that launches the job, in the service environment, or in the container entrypoint. A process that does not choose a GPU explicitly generally starts on device 0, as described in the ROCm programming guide.
These variables are convenience controls, not a security boundary. AMD warns that an untrusted process can change or clear them before runtime initialization. For isolation between tenants or jobs, expose only selected device nodes through a container as described below.
What is the correct PyTorch configuration for multi-GPU training?
Use PyTorch DistributedDataParallel (DDP), including on a single Linux host. AMD explicitly recommends DDP instead of DataParallel for multi-GPU training because each process can own one GPU and communicate through ROCm’s collective layer.
Also popular on Amazon
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
- Install a PyTorch build whose ROCm version matches the ROCm stack selected for the host. Verify the supported combination in AMD’s ROCm and PyTorch environment guide.
- Launch one process per GPU with the PyTorch distributed launcher or an equivalent process manager.
- Inside each process, bind the local rank to its GPU and initialize the distributed process group before constructing the model.
- Use a distributed sampler so each rank receives a distinct shard of the training data, and call the sampler’s epoch-setting method each epoch.
- Wrap the model in DDP after moving it to the rank’s device. Save checkpoints from one designated rank to avoid concurrent writes.
RCCL is the AMD collective-communication library used for multi-GPU and multi-node operations. It can use PCIe and, on supported platforms, xGMI interconnects. A healthy DDP job therefore depends on both framework compatibility and a functioning topology; a model script cannot compensate for a slot that does not route atomics or a card that the runtime cannot see.
How should you configure large-model inference?
Inference does not automatically benefit from the same layout as training. A single process may need to place different model layers on different GPUs, while separate requests can be assigned to separate cards. With Hugging Face Accelerate, define a maximum-memory map for every GPU so automatic placement does not fill one card unexpectedly and then fail with an out-of-memory error.
Reserve headroom for activations, the key-value cache and temporary kernels; the usable capacity is less than the VRAM number printed by a hardware utility. If you run independent inference workers, give each worker a specific visibility list and a fixed device assignment. If you shard one model, keep the map explicit and verify the resulting placement before serving traffic.
How do you isolate GPUs in Docker?
The host must already have the AMD kernel driver and Docker Engine. AMD’s Container Runtime Toolkit supports CDI and runtime injection, while manual device passthrough works without the toolkit. The shared compute interface is /dev/kfd; individual render nodes represent the graphics devices.
This example exposes two render nodes and keeps other GPUs out of the container:
docker run -it --rm
--device /dev/kfd
--device /dev/dri/renderD128
--device /dev/dri/renderD129
--security-opt seccomp=unconfined
<image>
Passing all of /dev/dri exposes every GPU. Pass only the render nodes assigned to the job, or use the AMD Container Runtime Toolkit’s fine-grained selection. Inside the container, run rocminfo or amd-smi and confirm that only the intended cards appear. Docker namespaces provide stronger isolation than environment variables because they restrict access to the exposed device nodes, including applications that use amdgpu interfaces outside ROCm. See AMD’s ROCm Docker instructions.
Also popular on Amazon
- Portable and powerful USB-C HUB: BENFEI USB Type-C HUB, with super-soft and knot-free silicone woven design cable, meets most mobile office needs. Compact, lightweight, stylish, and powerful portable USB C Hub equipped with 1 x HDMI port, 1 x 100W charging, and 3 x USB ports. 18-month warranty, 24-hour response, to ensure you feel at ease when using our product.
- Design centered on comfort and reliability: Thanks to BENFEI's end-to-end in-house cable production capability, in-house PCBA and assembly capability, using the industry's most advanced silicone woven design and process, 20cm cable in length, no knots, super-soft, the HUB is easy to use in all scenarios: laptop, tablet, stand etc. Super-soft, 25000+ life cycles, to meet your daily carrying and office needs.
- 100W Charging: Support up to 90W USB C pass-through charging via Type-C port to keep your laptop powered. 10W is reserved for other interface operations. No data and video function on the Type-C port.
- 4K HDMI Display: The HDMI port supports media display at resolutions up to 4K 30Hz, keeping every incredible moment detailed and ultra vivid. Please note that the C port of the Host device needs to support video output.
- Transfer Files in Seconds: Transfer files and from your laptop at speeds up to 10 Gbps with USB A 3.2 port. Extra 2 USB A 2.0 ports are perfectly for your keyboards and mouse.
What performance should you expect from adding GPUs?
Scaling depends on model size, batch size, communication traffic, PCIe topology, interconnects and software versions. AMD’s 2025 guide revision 2.0 reports the following figures for DeepSeek-R1-Distill-Qwen-32B in a ROCm 7.1.1 and PyTorch 2.11.0 environment:
Recommended Free Tools
| GPUs | Reported output |
|---|---|
| 1 | 40 output tokens/sec |
| 4 | 189 output tokens/sec |
| 20 | 762 output tokens/sec |
These are AMD’s published results for that configuration, not a guarantee for another Radeon model, Linux kernel, prompt mix or workload. Four GPUs deliver less than four times the one-GPU figure in that table, illustrating why communication and memory placement matter. Use the figures as a reference point, then validate compatibility and stability on your exact stack without assuming linear scaling.
Why does a multi-GPU job hang at 100% utilization?
AMD identifies a missing iommu=pt kernel parameter as a common cause of a multi-GPU hang. Add it to the existing GRUB command line, rebuild the boot menu and reboot:
sudoedit /etc/default/grub
# Add iommu=pt inside GRUB_CMDLINE_LINUX_DEFAULT
sudo update-grub
sudo reboot
After reboot, verify the parameter is active:
cat /proc/cmdline
Do not remove other required parameters when editing GRUB. If the hang remains, recheck CPU-connected slots, matching lane widths, PCIe atomics support, power connectors and cooling before changing application code.
How do you fix “operation cannot be performed in the present state”?
Check whether one card is installed behind a chipset-connected slot or a bridge with a different electrical configuration. Move both cards to CPU-connected slots with matching lane widths or bifurcation settings, reboot, and repeat the visibility check. AMD documents this symptom specifically with two Radeon 7900 XTX cards in an unmatched topology.
What if rocminfo and amd-smi show no GPUs?
Confirm that the amdgpu module loaded for the running kernel and is not denylisted. Check that the user is in both video and render, then log in again after changing groups. On Secure Boot systems, sign or enroll the amdgpu-dkms module so the kernel will load it. Compare your GPU and distribution against AMD’s support matrix before reinstalling packages.
Also popular on Amazon
- 【Read before You Buy】 Note: This adapter is USB 2.0 version and cannot transmit HDM, VGA, or other video signals. Nevertheless, they are fully capable of charging devices,duplicating files, and can be seamlessly integrated with USB-C earphones, wireless network adapters, and SD card adapters.
- 【Easy to Use and Safe】Thanks to modern manufacturing techniques, we've made these adapters sufficiently compact so that they can remain inserted in your device without noticeable protrusion or inconvenience. This means you don't have to constantly plug and unplug them, reducing the likelihood of wear and misalignment, and making them more convenient to carry around.
- 【Reliable Quality】Engineered for enhanced durability, durable aluminum alloy shell material,get excellent wear resistance and heat dissipation,the male USB C and female USB connectors & the male USB and female USB C connectors are designed to be plugged and unplugged up to 20000 times. Provides data transfer, device charging, memory space expansion, and additional computer peripherals.
- 【Think more for you】Do you need to connect a USB-C-enabled device to an odd device that only has USB-A ports? Then these USB-A male to USB-C female adapters are made for you.Simply insert the adapter into the USB-A port on the device, and you can instantly connect your USB-C device to the device that originally didn't have the correct connection port.
- 【Trusted xiwxi Quality and Service】As a responsible brand seller, you will receive xiwxi's 12-month Quality assurance and lifetime friendly customer service, you're not just buying a product,you're investing in peace of mind with all-round quality and exceptional customer service.
How do you prevent resets when the desktop is running?
Reduce concurrent workloads, stop unnecessary HIP or graphics applications, or move training and inference to a headless session. A display compositor consumes GPU resources continuously, and AMD lists combinations such as desktop plus machine learning or machine learning plus Blender/HIP as reset scenarios. For production jobs, reserve a display GPU or run the compute host without a graphical desktop.
How do you keep a multi-GPU deployment reproducible?
- Record the GPU models, PCIe slot mapping, lane widths, BIOS bifurcation settings and power-supply capacity.
- Pin the Linux distribution, kernel, amdgpu package, ROCm release and PyTorch build to a supported combination.
- Run
rocminfoandamd-smiafter every driver or kernel change and save the output with the job configuration. - Set explicit visibility and rank-to-device mappings instead of relying on device 0.
- Use DDP for training, explicit memory maps for sharded inference, and RCCL-compatible settings for collective communication.
- Use Docker render-node passthrough when jobs need isolation, and verify the container sees exactly the assigned GPUs.
- Monitor temperature, power and reset events; a stable software configuration cannot overcome inadequate cooling or a PSU operating beyond its sustained capacity.
Frequently Asked Questions
Can I use a chipset-connected PCIe slot for a second AMD GPU?
It may enumerate, but AMD’s recommended two-GPU layout uses CPU-connected slots with matching electrical configuration. A chipset slot can reduce performance and has been associated with HIP state errors, so use CPU-connected slots whenever the motherboard provides them.
Should I set CUDA_VISIBLE_DEVICES on an AMD system?
Only when the application uses a CUDA-compatible selection path on AMD HIP. ROCm and HIP applications generally use ROCR_VISIBLE_DEVICES or HIP_VISIBLE_DEVICES; choose the variable that matches the runtime and set it before the process starts.
Is Docker required to run several AMD GPUs?
No. Native ROCm installation is sufficient for a trusted single-user host. Docker becomes useful when you need repeatable environments or stronger device isolation than process environment variables provide.
Why does adding a second GPU fail even though both cards appear in amd-smi?
Visibility proves that the driver can enumerate the cards, not that the topology supports peer synchronization. Check CPU-rooted slots, matching lane configuration, PCIe atomics routing, IOMMU settings, power delivery and cooling before debugging the model code.

