Code Monkey home page Code Monkey logo

Comments (3)

tomlankhorst avatar tomlankhorst commented on July 4, 2024 1

I must have made a mistake somewhere while editing the pinning since I can't reproduce the 'worse' results with your configuration anymore. Thanks for helping me out anyway!

from gpu-passthrough-tutorial.

bryansteiner avatar bryansteiner commented on July 4, 2024

Hey sorry for the delayed response...

First, let me refer you to this section of the arch wiki page on cpu pinning. Here you'll see the use of the command lspcu -e. The cpu threads are numbered on the leftmost "CPU" column and you can see which threads share the same physical core under the "CORE" column. Pretty much every tutorial on the subject will tell you to pin threads together by physical cores and not across different physical cores. In your modified example, you're pinning threads across different physical cores. This is simply not recommended anywhere and I'm genuinely surprised to see better performance numbers.

Let's say based on the CPU topography for your 3950X that I wanted to pass physical cores 8-15 (bottom row of lstopo) to the guest and leave 0-7 (top row of lstopo) to the host. This corresponds to passing 16 out of 32 logical threads to your VM. Here's what I'd expect the correct pinning configuration with threads paired by physical cores to look like:

<vcpu placement="static">16</vcpu>
<cputune>
    <vcpupin vcpu="0" cpuset="8"/>
    <vcpupin vcpu="1" cpuset="24"/>
    <vcpupin vcpu="2" cpuset="9"/>
    <vcpupin vcpu="3" cpuset="25"/>
    <vcpupin vcpu="4" cpuset="10"/>
    <vcpupin vcpu="5" cpuset="26"/>
    <vcpupin vcpu="6" cpuset="11"/>
    <vcpupin vcpu="7" cpuset="27"/>
    <vcpupin vcpu="8" cpuset="12"/>
    <vcpupin vcpu="9" cpuset="28"/>
    <vcpupin vcpu="10" cpuset="13"/>
    <vcpupin vcpu="11" cpuset="29"/>
    <vcpupin vcpu="10" cpuset="14"/>
    <vcpupin vcpu="11" cpuset="30"/>
    <vcpupin vcpu="10" cpuset="15"/>
    <vcpupin vcpu="11" cpuset="31"/>
<cputune>

Please go ahead and confirm whether your current configuration outperforms this one. I would not expect it to. Here's the configuration I suggest you run a comparison with in which threads are paired across different physical cores:

<vcpu placement="static">16</vcpu>
<cputune>
    <vcpupin vcpu="0" cpuset="8"/>
    <vcpupin vcpu="1" cpuset="9"/>
    <vcpupin vcpu="2" cpuset="10"/>
    <vcpupin vcpu="3" cpuset="11"/>
    <vcpupin vcpu="4" cpuset="12"/>
    <vcpupin vcpu="5" cpuset="13"/>
    <vcpupin vcpu="6" cpuset="14"/>
    <vcpupin vcpu="7" cpuset="15"/>
    <vcpupin vcpu="8" cpuset="24"/>
    <vcpupin vcpu="9" cpuset="25"/>
    <vcpupin vcpu="10" cpuset="26"/>
    <vcpupin vcpu="11" cpuset="27"/>
    <vcpupin vcpu="10" cpuset="28"/>
    <vcpupin vcpu="11" cpuset="29"/>
    <vcpupin vcpu="10" cpuset="30"/>
    <vcpupin vcpu="11" cpuset="31"/>
<cputune>

I've also gone ahead and edited the README for the tutorial to make the cpu pinning section a little bit easier to understand. Please report back with your results.

from gpu-passthrough-tutorial.

bryansteiner avatar bryansteiner commented on July 4, 2024

Closing issue awaiting response

from gpu-passthrough-tutorial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.