Skip to content

Conversation

@probably-neb
Copy link
Collaborator

Workaround for users affected by #25899

Thanks to the work done by @kvark in kvark/blade#210, we have the ability to tell Vulkan (through blade) a specific GPU to use.

This will hopefully allow some of the users affected by #25899 to use Zed by allowing them to use a specific GPU, if the primary/default GPU will not work

Release Notes:

  • Added the ability to specify which GPU Zed uses on Linux by setting the ZED_DEVICE_ID environment variable. You can obtain the device ID of your GPU by running lspci -nn | grep VGA which will output each GPU on one line like:
    08:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104 [GeForce RTX 3070] [10de:2484] (rev a1)
    
    where the device ID here is 2484. This value is in hexadecimal, so to force Zed to use this specific GPU you would set the environment variable like so:
    ZED_DEVICE_ID=0x2484
    
    Make sure to export the variable if you choose to define it globally in a .bashrc or similar

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 26, 2025
@probably-neb probably-neb enabled auto-merge (squash) March 26, 2025 20:23
@probably-neb probably-neb merged commit 1463b4d into main Mar 26, 2025
15 checks passed
@probably-neb probably-neb deleted the allow-forcing-gpu-device-id branch March 26, 2025 20:32
@knweiss
Copy link

knweiss commented Apr 5, 2025

I am wondering: Shouldn’t this rather use the VENDORID:DEVICEID combination (“10de:2484” in the example) instead of only the DEVICEID? As far as I know the DEVICEID is only unique per vendor.

@probably-neb
Copy link
Collaborator Author

Wow, thanks for catching that @knweiss. I had no idea device ID was not unique. Will get this fixed! (PRs also welcome :) )

@kvark
Copy link
Contributor

kvark commented May 11, 2025

Technically, yes. But the chance of getting a single node with multiple GPUs with the same ID are quite low.

@probably-neb
Copy link
Collaborator Author

If and when you add the ability to specify the vendor ID when initializing the context @kvark, I will make sure we support passing it. Agreed it is very unlikely to occur, especially for Zed where most cases this flag is needed is when there is an iGPU as well as a discrete GPU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants