Check the ROP unit count under Linux? Affects all RTX 50XX cards

Oooooh, some progress here (I suspected that the PhysicalGPUHandle from NVAPI was key here):

This comes from the falahati/NvAPIWrapper: NvAPIWrapper is a .Net wrapper for NVIDIA public API, capable of managing all aspects of a display setup using NVIDIA GPUs project. Question would be: does that code work with the Linux NVAPI?

So this GetROPCount function is listed here, line 572:

And it is part of the “// Private Internal NvAPI Functions”, not the public ones. The questions are:

  • do you need the NDA access to call the private NvAPI functions? Here “Private” might mean programmatically, not as a NDA status. From Add custom resolution · Issue #13 · falahati/NvAPIWrapper the author mentions NDA API, declining some new functionality on this basis. Therefore one could assume everything he has implemented does not require an NDA, To verify.
  • does this function exists in Linux driver API?

Windows:

Ignore the debug print. It’s irrelevant.

Linux:

This took no time whatsoever to check.

And those are the latest API versions? If so there is no possibility under Linux then.

“Linux NVAPI”? please excuse me if I missed something so big somehow, but I thought NVAPI was only available on Windows, no? At least github.com/NVIDIA/nvapi seems to contain only windows stuff…

There must be an API at least for nvidia-smi to work. The NVAPI documentation states in which OS each function is implemented. Too bad they do not align both driver platforms.

When people used to mine on NVIDIA GPUs under Linux they managed to call low-level NVAPI functions.

Practically each Ethereum miner did it at one point, so there’s … some API, as to whether it matches what’s available under Windows I’ve no idea.

And if I’m not hallucinating I remember I heard an NVIDIA employee claim/say that the NVIDIA driver Windows and Linux code bases closely match one another.

Of course hardware abstraction layers are totally different, as well support for various features, e.g. there’s no Direct3D under Linux.

I thought they were using CUDA, no? (which is a different API on top of the driver)

correct, it’s in one of the pinned topics here, if I recall, but that’s driver: the layer below NVAPI and CUDA…

May I ask which library you loaded exactly? (full path I mean) Thanks!

On Linux nvidia-smi uses NVML.

I’m assuming he used /usr/lib/x86_64-linux-gnu/libnvidia-api.so.1. You can find sample code here: NVAPI libnvidia-api.so.1 relevance · Issue #100 · jp7677/dxvk-nvapi · GitHub

Unfortunately, I can verify that the ROP getter ID is not available.

hmm, on my system (Debian with data-center driver 570), I get this:

$ strings /usr/lib/x86_64-linux-gnu/libnvidia-api.so.1 |grep -i enumphysicalgpus
$ strings /usr/lib/x86_64-linux-gnu/libnvidia-api.so.1 |grep -i initialize
NVAPI_API_NOT_INITIALIZED
NVAPI_STEREO_NOT_INITIALIZED
$ 

Is my libnvidia-api stripped of some stuff maybe or what? I feel lost…

You’re not going to find these as strings. You have to call nvapi_QueryInterface with a numeric ID to get the function address. See the sample code I’ve linked.

ah, I see… that’s some higher level of witchcraft ;-)

Thanks to all. Until we get help on that matters from nvidia, I was successful to run Windows on an USB stick using Ventoy, as explained in the 2 first links I pasted above.

  • I used (in Linux) Ventoy to prepare a 64GB USB key. Very important: by default the first partition created on the key (the one where you will copy the Windows VHD file) is formatted in exFAT. The installer has no option to change that, but you can (need to) reformat the partition to NTFS (using CLI or gparted). Even if the documentation says that latest Win versions now work with exFAT, it did not for me (Windows was booting fine from the key, until blue screen with a “VHD initialization failed error” message). Leave the second partition alone.
  • I used the Win10 22H2 iso file I downloaded from Microsoft website and the Win10 version of vhdimg v3.0 from Github.
  • I used Virtualbox on my Arch Linux to install Windows 10 in a 40GB, fixed size, VHD file (note that by default, Virtualbox uses VDI, not VHD, so you have to take care of changing this when creating the virtual machine.) When asked if you have a license key, you can skip this part by clicking “I do not have one” (you do not need a Windows license, since it can run without one as long as you do not have to personalise it.)
  • I then copied the VHD in the root of the key (1st partition) and the ventoy_vhdboot.img file in a /ventoy directory I created (also 1st partiton).
  • Reboot, and Windows was running from the key (I had to change boot order in the UEFI bios and also disabled Secure Boot, but you can also add the secure boot key if you wish, as explained in Ventoy documentation). Then under Windows I installed the nvidia drivers, rebooted, then GPU-Z and ran it. All good, 112 ROPs for me.

So it is a bit of work but it is not that painful (do not forget to reformat the USB key first partition in NTFS!) and you do not need to dual boot, find space on your drive, and let Windows mess up your bootloader.

And if I’m not hallucinating I remember I heard an NVIDIA employee claim/say that the NVIDIA driver Windows and Linux code bases closely match one another.

Well, “closely” is vague enough not to mean 100% :) In addition, he may have talked about the public API functions. In the NVAPI wrapper Github project, the ROPCount is listed as “Private Internal NvAPI Functions”. Usually this is reserved for functions that are not guaranteed of being implemented and for which signature/returned data may be subject to change without notice.

Best way to view ROPs as a Linux user is to get Hiren’s BootCD on your Ventoy USB and fire it up, it have GPU-Z pre-installed.

It’s a bummer we don’t have proper ways to get it directly in Linux.

I did not know this one.
EDIT: as mentioned by @birdie below, the nvidia driver has to be installed, otherwise GPU-Z does not return card information, only internal database info, and therefore could not detect defect!

The NVIDIA driver must be installed for GPU-Z to work correctly. Without it GPU-Z uses the built-in database with predefined values.

Good point. I am not sure the Hiren’s Boot CD allows installation of the driver. On the other hand, my method described above does: at the last step I installed the driver under Windows, rebooted and then ran GPU-Z.

On GPU-Z forum I proposed this enhancement: if they could provide in the next version an option that differenciates data taken from the database or from querying the driver (e.g. using colours or italics).

I see also that this function that returns ROP counts is also called NvAPI_GPU_GetRasterBackendCount in this project:

It has the same Id (0xfdc129fa). Is there reference under this name in the Linux driver by any chance? NvAPI_GPU_GetRasterBackendCount might be the former name.

I just realise: this is the NVAPI Wine project! So maybe the key is just the Id address, and this works fine in Linux too? Need some brains here!

Other mentions of that function: