diff --git a/src/cam/drm.cpp b/src/cam/drm.cpp
index b0602c942853..b2a6b0bba9e8 100644
--- a/src/cam/drm.cpp
+++ b/src/cam/drm.cpp
@@ -430,7 +430,8 @@ int Device::init()
 int Device::openCard()
 {
 	const std::string dirName = "/dev/dri/";
-	int ret = -ENOENT;
+	bool found = false;
+	int ret;
 
 	/*
 	 * Open the first DRM/KMS device beginning with /dev/dri/card. The
@@ -449,24 +450,38 @@ int Device::openCard()
 	}
 
 	for (struct dirent *res; (res = readdir(folder));) {
+		uint64_t cap;
+
 		if (strncmp(res->d_name, "card", 4))
 			continue;
 
 		const std::string devName = dirName + res->d_name;
 		fd_ = open(devName.c_str(), O_RDWR | O_CLOEXEC);
-		if (fd_ >= 0) {
-			ret = 0;
-			break;
+		if (fd_ < 0) {
+			ret = -errno;
+			std::cerr << "Failed to open DRM/KMS device " << devName << ": "
+				  << strerror(-ret) << std::endl;
+			continue;
 		}
 
-		ret = -errno;
-		std::cerr << "Failed to open DRM/KMS device " << devName << ": "
-			  << strerror(-ret) << std::endl;
+		/*
+		 * Skip devices that don't support the atomic API, to avoid
+		 * selecting a DRM device corresponding to a GPU.
+		 */
+		ret = drmGetCap(fd_, DRM_CLIENT_CAP_ATOMIC, &cap);
+		if (ret < 0) {
+			drmClose(fd_);
+			fd_ = -1;
+			continue;
+		}
+
+		found = true;
+		break;
 	}
 
 	closedir(folder);
 
-	return ret;
+	return found ? 0 : -ENOENT;
 }
 
 int Device::getResources()
