Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add nitro vulkan to support AMD GPU/ APU and Intel Arc GPU #2056

Merged
merged 5 commits into from
Feb 22, 2024

Conversation

hiro-v
Copy link
Contributor

@hiro-v hiro-v commented Feb 16, 2024

Describe Your Changes

  • Add vulkan nitro to support AMD GPU and Intel Arc version
  • Verify Jan with nitro vulkan can run on AMD GPU
  • Verify Jan with nitro vulkan can run on Intel Arc GPU
  • Add setting toggle boolean to enable Vulkan GPU
  • Add logic to use nitro binary in linux-vulkan and windows-vulkan
  • Add settings for a number as INT () which we will use as environment variables VULKAN_DEVICE_INDEX=<index> when executing nitro vulkan.
  • Update settings frontend with jan/settings/settings.json
    CleanShot 2024-02-17 at 17 03 38@2x
    CleanShot 2024-02-17 at 17 14 33@2x

Fixes Issues

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@hiro-v
Copy link
Contributor Author

hiro-v commented Feb 17, 2024

Report on real machine with AMD Ryzen 5 and AMD Radeon GPU (6600)

Machine spec
CleanShot 2024-02-17 at 17 13 57@2x

Performance
==> Summary: AMD GPU consistently yield 300% better performance compared to AMD Ryzen CPU (which is really good already)

  • Tiny Llama 1.1B

    • AMD GPU
      CleanShot 2024-02-17 at 17 00 11@2x
    • AMD Ryzen CPU
      CleanShot 2024-02-17 at 17 06 16@2x
  • Mistral 7B Q4

    • AMD GPU
      CleanShot 2024-02-17 at 17 00 59@2x
    • AMD Ryzen CPU
      CleanShot 2024-02-17 at 17 07 25@2x

@louis-jan
Copy link
Contributor

louis-jan commented Feb 20, 2024

Updated:

  • vulkan enabled: should be a boolean value located in the root of settings.json.
  • gpus_in_use: reuse, and it should be shared between Cuda & Vulkan settings while resetting when switching between them.
  • Do not use the VULKAN_DEVICE_INDEX variable; instead, use GGML_VULKAN_DEVICE. Only support using one selected GPU at a time, and both Nvidia and AMD GPUs should work.
  • Handle crash on app launch due to undefined value (settings.json > vulkan)
  • nvidia-smi yield error when vulkan enabled (wrong device index)
  • Wrong Linux vulkan executable binary download url

In progress:

  • GPU devices list

@louis-jan louis-jan force-pushed the feat/nitro_vulkan branch 2 times, most recently from 452e127 to 45be8cc Compare February 21, 2024 16:22
@louis-jan
Copy link
Contributor

louis-jan commented Feb 21, 2024

Update:

  • GPU devices list

NOTES: There is a limitation with the current approach; GPU VRAM information is not retrieved. Will investigate further.

The screenshots are for demo purposes; please see the AMD performance above.

Screenshot 2024-02-21 231505
Screenshot 2024-02-21 231508
Screenshot 2024-02-21 231636

@louis-jan louis-jan force-pushed the feat/nitro_vulkan branch 2 times, most recently from 503ea79 to 3250e80 Compare February 21, 2024 16:29
@louis-jan louis-jan marked this pull request as ready for review February 21, 2024 16:48
@louis-jan
Copy link
Contributor

Known issue:
Enable Vulkan support on unsupported GPU device would cause this error. The GPU list would be empty in App > Settings.

image

@louis-jan
Copy link
Contributor

Experimental feature: 0.4.7

Copy link
Contributor

@louis-jan louis-jan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@louis-jan louis-jan merged commit 926f19b into dev Feb 22, 2024
7 checks passed
@louis-jan louis-jan deleted the feat/nitro_vulkan branch February 22, 2024 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants