Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug detecting card in pci_find_instance ? #37

Closed
pigfrown opened this issue Jun 4, 2019 · 4 comments
Closed

bug detecting card in pci_find_instance ? #37

pigfrown opened this issue Jun 4, 2019 · 4 comments

Comments

@pigfrown
Copy link

pigfrown commented Jun 4, 2019

I get the following error message when running the latest version

Cannot find DRI instance for pci:0000:01:00.0

On my system /sys/kernel/debug/dri/$X/name is an empty file, but pci_find_instance seems to expect there to be something in there. This is causing the above error (if I understand correctly).

On my test system there are 5 cards, and they are numbered 0-5 in /sys/kernel/debug/dri/ , so I removed the call to pci_find_instance entirely and replaced

int instance = pci_find_instance(buffer);

at line 1505 with

int instance = i;

and everything works as expected. However this doesn't work on all rigs.

My test system has Lexa rx550's in it, so I also had to add dev->device_id == 0x699f) || // Lexa [Radeon RX550] to IsRelevantDeviceID to get everything working. I get the same problem on a a 580/570 rig though (exactly the same kernel/amdgpu-pro version).

System details:

Ubuntu 16.04,
kernel 4.4.0
amdgpu-pro 18.10-572953

Thanks

@mDog288
Copy link

mDog288 commented Jun 13, 2019

Мой английский плох как и С, но для себя я нашел выход с драйвером 18.10 (почему-то майнинг на ethash с более свежим драйвером менее производителен) и интегрированной видеокартой.
смысл в том что в оригинале из файла /sys/kernel/debug/dri/%s/name берется pci порт устройства, я же сравниваю только название драйвера для устройства. может работать не корректно, используйте на свой страх и риск))

--- AmdMemTweak.cpp.orig	2019-06-13 10:42:59.000000000 +0300
+++ AmdMemTweak.cpp	2019-06-13 14:31:30.576992117 +0300
@@ -775,24 +775,15 @@
 		if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) continue;
 
 		char name[300];
-		snprintf(name, sizeof(name) - 1, "/sys/kernel/debug/dri/%s/name", entry->d_name);
+		snprintf(name, sizeof(name) - 1, "/sys/class/hwmon/hwmon%s/name", entry->d_name);
 		FILE * f = fopen(name, "r");
 		if (!f) continue;
 
-		char device[256];
-		device[sizeof(device) - 1] = 0;
-		int parsed_device = fscanf(f, "%*s %255s", device);
+		char device [256];
+		fscanf(f, "%s", device);
 		fclose(f);
 
-		if (parsed_device != 1) continue;
-
-		// strip off dev= for kernels > 4.7
-		if (strstr(device, "dev="))
-		{
-			memmove(device, device + 4, strlen(device) - 3);
-		}
-
-		if (!strcmp(pci_string, device))
+		if (!strcmp(device, "amdgpu"))
 		{
 			closedir(dir);
 			return atoi(entry->d_name);

патч работает, но применяет параметры сразу ко всем ГПУ, игнорирует параметр --i((

@Eliovp
Copy link
Owner

Eliovp commented Jul 27, 2019

Yeah, your issue is mainly due to onboard vga or an unknown gpu.

There's a fork here with a fix to ignore onboard vga.
i'll see to add it here

@Eliovp Eliovp closed this as completed Jul 27, 2019
@mDog288
Copy link

mDog288 commented Jul 29, 2019

This solution does not work correctly, at the moment I am updating the system so that everything works without my modifications.

@vinibali
Copy link

This fork contains the workaround to skip some APUs or IGPs:
https://gitlab.com/vinibali/amdmemorytweak/-/tree/0.2.3_mod
I added AMD's 690G to the list, because I had the same problem with this chipset!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants