Skip to content

Commit 7b0fdb3

Browse files
committed
Print "amdgpu not enabled" warning just once
If printed in the getvram() function, it will appear in the main screen and overlap with other elements, which is undesirable.
1 parent e994cc2 commit 7b0fdb3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

detect.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ unsigned int init_pci(unsigned char bus, const unsigned char forcemem) {
158158

159159
ret = getvram();
160160
if (ret == 0) {
161+
if (strcmp(drm_name, "amdgpu") == 0) {
162+
#ifndef ENABLE_AMDGPU
163+
printf(_("amdgpu DRM driver is used, but amdgpu VRAM usage reporting is not enabled\n"));
164+
#endif
165+
}
161166
printf(_("Failed to get VRAM usage, kernel likely too old\n"));
162167
goto out;
163168
}
@@ -193,8 +198,6 @@ unsigned long long getvram() {
193198
request.query = AMDGPU_INFO_VRAM_USAGE;
194199

195200
ret = drmCommandWrite(drm_fd, DRM_AMDGPU_INFO, &request, sizeof(request));
196-
#else
197-
printf(_("amdgpu DRM driver is used, but amdgpu VRAM usage reporting is not enabled\n"));
198201
#endif
199202
}
200203
if (ret) return 0;

0 commit comments

Comments
 (0)