olealgoritme / gddr6

Linux​ based GDDR6/GDDR6X VRAM temperature reader for NVIDIA RTX 3000/4000 series GPUs.
79 stars 30 forks source link

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

Open Ahmed-Mahmod-Salem opened 6 months ago

Ahmed-Mahmod-Salem commented 6 months ago

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

olealgoritme commented 6 months ago

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

Ahmed-Mahmod-Salem commented 5 months ago

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.

daniel-dona commented 5 months ago

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

Ahmed-Mahmod-Salem commented 5 months ago

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

daniel-dona commented 5 months ago

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 commented 5 months ago

It was that!

$ sudo gddr6
Device: RTX 3080 Ti GDDR6X (GA102 / 0x2208) pci=2d:0:0
VRAM Temps: |  52°C |
daniel-dona commented 5 months ago

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...

olealgoritme commented 5 months ago

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