intel / idxd-config

Accel-config / libaccel-config
Other
56 stars 34 forks source link

Error running dsa_test as user #16

Closed ozhuraki closed 2 years ago

ozhuraki commented 2 years ago
# accel-config -v
3.4.6.4.gitc5271866
# uname -rv
5.18-051800-generic #202205230807-Ubuntu SMP PREEMPT_DYNAMIC Mon May 23 17:26:06 UTC
# cat /proc/cmdline
[...] intel_iommu=on,sm_on

# id
uid=1000(test) gid=1000(test) groups=1000(test),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),121(lpadmin),131(lxd),132(sambashare),998(docker)
# accel-config list
[
]
# cat dsa0.conf
[
  {
    "dev":"dsa0",
    "token_limit":0,
    "groups":[
      {
        "dev":"group0.0",
        "tokens_reserved":0,
        "use_token_limit":0,
        "tokens_allowed":8,
        "grouped_workqueues":[
          {
            "dev":"wq0.0",
            "mode":"dedicated",
            "size":16,
            "group_id":0,
            "priority":10,
            "block_on_fault":1,
            "type":"user",
            "name":"app00",
            "threshold":15
          }
        ],
        "grouped_engines":[
          {
            "dev":"engine0.0",
            "group_id":0
          },
        ]
      },
      {
        "dev":"group0.1",
        "tokens_reserved":0,
        "use_token_limit":0,
        "tokens_allowed":8,
        "grouped_workqueues":[
          {
            "dev":"wq0.1",
            "mode":"dedicated",
            "size":16,
            "group_id":1,
            "priority":10,
            "block_on_fault":1,
            "type":"user",
            "name":"app01",
            "threshold":15
          }
        ],
        "grouped_engines":[
          {
            "dev":"engine0.1",
            "group_id":1
          },
        ]
      },
      {
        "dev":"group0.2",
        "tokens_reserved":0,
        "use_token_limit":0,
        "tokens_allowed":8,
        "grouped_workqueues":[
          {
            "dev":"wq0.2",
            "mode":"dedicated",
            "size":16,
            "group_id":2,
            "priority":10,
            "block_on_fault":1,
            "type":"user",
            "name":"app02",
            "threshold":15
          }
        ],
        "grouped_engines":[
          {
            "dev":"engine0.2",
            "group_id":2
          },
        ]
      },
      {
        "dev":"group0.3",
        "tokens_reserved":0,
        "use_token_limit":0,
        "tokens_allowed":8,
        "grouped_workqueues":[
          {
            "dev":"wq0.3",
            "mode":"dedicated",
            "size":16,
            "group_id":3,
            "priority":10,
            "block_on_fault":1,
            "type":"user",
            "name":"app03",
            "threshold":15
          }
        ],
        "grouped_engines":[
          {
            "dev":"engine0.3",
            "group_id":3
          },
        ]
      },
    ]
  }
]
# sudo accel-config load-config -e -c dsa0.conf
Warning: "token" attributes are deprecated
Enabling device dsa0
Enabling wq wq0.3
Enabling wq wq0.2
Enabling wq wq0.1
Enabling wq wq0.0
# ./dsa_test -v -w 0 -d dsa0/wq0.0 -f 0x0 -o 0x3
[debug] umwait supported
open: Permission denied
[error] No usable wq found
# sudo ./dsa_test -v -w 0 -d dsa0/wq0.0 -f 0x0 -o 0x3
[debug] umwait supported
[ info] alloc wq 0 shared 1 size 16 addr 0x7f2e37210000 batch sz 0x400 xfer sz 0x80000000
[ info] testmemory: opcode 3 len 0x4e20 tflags 0 num_desc 1
[debug] initilizing task 0x55a9ea1e5bc0
[debug] Mem allocated: s1 0x55a9ea1e5d40 s2 0 d1 0x55a9ea1eabc0 d2 0
[ info] preparing descriptor for memcpy
[ info] Submitted all memcpy jobs
[debug] desc addr: 0x55a9ea1e4a40
[debug] desc[0]: 0x0300000c00000000
[debug] desc[1]: 0x000055a9ea1e5ca0
[debug] desc[2]: 0x000055a9ea1e5d40
[debug] desc[3]: 0x000055a9ea1eabc0
[debug] desc[4]: 0x0000000000004e20
[debug] desc[5]: 0x0000000000000000
[debug] desc[6]: 0x0000000000000000
[debug] desc[7]: 0x0000000000000000
[debug] completion record addr: 0x55a9ea1e5ca0
[debug] compl[0]: 0x0000000000000001
[debug] compl[1]: 0x0000000000000000
[debug] compl[2]: 0x0000000000000000
[debug] compl[3]: 0x0000000000000000
[ info] verifying task result for 0x55a9ea1e5bc0
# 
davejiang commented 2 years ago

You as the system administrator must change the /dev node permission or ownership to allow the user to access the device. By default it's setup for root. The scheme is the admin configures the wq, and then assign permission to apps.

ozhuraki commented 2 years ago

OK, thanks, sorted this out!