gddr6 icon indicating copy to clipboard operation
gddr6 copied to clipboard

Error at line 57, file /home/username/gddr6/lib/src/gddr6.c (1) [Operation not permitted]

Open Ahmed-Mahmod-Salem opened this issue 1 year ago • 8 comments
trafficstars

the code fails at this point everytime I try to run it

Ahmed-Mahmod-Salem avatar May 19 '24 09:05 Ahmed-Mahmod-Salem

Did you enable iomem=relaxed and run it with sudo?

olealgoritme avatar May 20 '24 15:05 olealgoritme

yes, I did everything in the description, didn't work, turns out it is a problem because we are trying to access /dev/mem which is locked by the kernel, had to recompile the kernel, and disabled secure boot, don't really know for sure which one of the two attempts did it, maybe it was both, but finally it worked.

Ahmed-Mahmod-Salem avatar May 20 '24 21:05 Ahmed-Mahmod-Salem

Getting the same error when running the gddr6 binary:

$ sudo gddr6 
Error at line 57, file /home/dani/gddr6/lib/src/gddr6.c (1) [Operation not permitted]

I verified that iomem (iomem=relaxed) parameter is in the boot command line, kernel is 5.19.0-41-generic (Ubuntu 22.04)

I can provide additional information of the system if needed

daniel-dona avatar May 21 '24 08:05 daniel-dona

yeah, it is a deep hassle, my advice, just don't.

Ahmed-Mahmod-Salem avatar May 21 '24 10:05 Ahmed-Mahmod-Salem

Additional info from the kernel:

[ 8903.861420] Lockdown: gddr6: /dev/mem,kmem,port is restricted; see man kernel_lockdown.7

Looks like is related to UEFI secure boot

$ sudo mokutil --sb
SecureBoot enabled

I'll test to disable secure boot and see if it works

daniel-dona avatar May 21 '24 10:05 daniel-dona

It was that!

$ sudo gddr6
Device: RTX 3080 Ti GDDR6X (GA102 / 0x2208) pci=2d:0:0
VRAM Temps: |  52°C |

daniel-dona avatar May 21 '24 11:05 daniel-dona

yeah, it is a deep hassle, my advice, just don't.

With this Ubuntu kernel just the iomem=relaxed and secure boot disabled works, no kernel recompile required. Maybe this can be added in the README, I can create a PR @olealgoritme if you agree...

daniel-dona avatar May 21 '24 11:05 daniel-dona

@daniel-dona Yes, please create a PR that highlights necessary UEFI Secure Boot setting in the README. Thank you!

olealgoritme avatar May 21 '24 12:05 olealgoritme