I need to change default GPU ID settings, but don't know how

I recently acquired a GTX 1050 Ti from a good friend of mine, and installed it in a lower slot than my RX 6900XT. I primarily wish to use this 1050 Ti as a video encoder for streaming, recording, and rendering video, and so after installing I ran neofetch and saw that it was physically installed correctly and is being read by the system correctly. I’d hoped this was all I needed to do, but my naivety got the better of me. I needed to install drivers for it (cuz duh), so I installed the nvidia and nvidia-settings packages. After rebooting, I was able to record and render video using the 1050 Ti, but was unable to use the RX 6900XT for gaming.

Looking at Info Center > Graphics > Vulkan, I saw the problem.

Devices: count = 2
GPU id = 0 (Nvidia GeForce GTX 1050 Ti)
Layer-Device Extensions: count = 0

GPU id = 1 (AMD RADV SIENNA_CICHLID)
Layer-Device Extentions: count = 0

After doing some research, I found the Nvidia drivers set GPU id to FASTEST_FIRST by default, instead of going by PCI_BUS_ID, like one would expect. FASTEST_FIRST guesses which GPU installed is faster by using a simple heuristic, according to Nvidia documentation. This is an environment variable one can change, but I can’t figure out how. I’ve read a ton recently on the subject, but I just can’t quite figure it out. Can I get some help?

Welcome aboard! :smile:

I’m merely guessing here, but maybe you can set that variable in file /etc/environment?
Command man environment may help more.
Also, command man systemd.environment-generator might help.

I tried setting the variable in /etc/environment but that didn’t do anything, sadly. Then, i checked the man files for environment and systemd.environment-generator and experimented for a while with their instructions, but that didn’t help either. I saw a post on Nvidia’s developer forums that said to do this: export CUDA_DEVICE_ORDER=PCI_BUS_ID and it stuck kinda?
running echo $CUDA_DEVICE_ORDER returned PCI_BUS_ID which is what I need, but nothing’s happening. Info Center still shows the 1050 Ti as GPU 0, and games only run on that card. My 6900XT is doing something tho, flicking between 0 and 4% usage.

At this point, I’m not sure what else I could try. Different drivers, perhaps? I really don’t know what to do.

Which card is your monitor connected to?

Which DE are you running?

6900XT, EndeavourOS KDE Plasma

It sounds like the NVIDIA driver is triggering render offload automatically.

Did you add any configuration? What did you do when you

?

Does it make any difference if you run e.g.

__NV_PRIME_RENDER_OFFLOAD=0 command

Welcome to the forum @spacefax :partying_face:

thanks <3

I’ve spent the last several days on this, I can’t remember exactly what I did and when, but here’s what I did:
first, i reached out to a friend of mine who is a huge linux nerd, and followed the suggestion she gave

it’s worth a try setting CUDA_DEVICE_ORDER=PCI_BUS_ID in ~/.profile if u havent already, though i doubt that it’s controlled per user

Nothing happened with this.

I tried export CUDA_DEVICE_ORDER=PCI_BUS_ID, and nothing happened there either, but it did set something. Typing echo $CUDA_DEVICE_ORDER returned PCI_BUS_ID.

Reading up on manuel’s suggestions, i modified /usr/lib/systemd/user-preset/90-systemd.preset but it seems to have reverted itself on reboot. Other similar files were unreadable. Not sure if that’s a format thing, or a nano thing.

I read up on this page and watched this video. The cuda developer documentation helped at least to understand what my system is doing, but not really to change it? I don’t know how to make use of the information there. The video kinda helped, but there wasn’t much I could do. Followed some of the things he talked about, but nothing happened.
I looked at my ~/.bashrc profile and wasn’t sure if I could do anything there to help.

I tried __NV_PRIME_RENDER_OFFLOAD=0 and many variants of that, rebooting with each, and still nothing changed.

I realize this is a fairly advanced and niche thing I’m trying to do, and I may not be ready for it, but I want to try to make it work to the best of my ability.
Oh, and sorry about earlier in the thread, i misread your post intially

How?

Such as?

That is an environment variable, so why were you rebooting?

I’m 99% certain that this is not related to CUDA.