Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pthread-setaffinity

英伟达官方文档,建议打开。

官方

https://github.com/microsoft/onnxruntime

会取 online cpu,把宿主机的都取到了,然后绑核,但是会报警告,因为容器通过 cgroup cpu set 特性,已经限制了容器只能使用特定核。

docker run --rm -ti --name builder -v $(pwd):/root/pthread-setaffinity \
-w /root/pthread-setaffinity --entrypoint clang \
envoyproxy/envoy-build-centos:75238004b0fcfd8a7f71d380d7a774dda5c39622 \
-DCOMMIT_ID="\"$(git rev-parse HEAD)\"" \
-D_GNU_SOURCE -D__USE_GNU -O0 -g -std=gnu99 -fPIC -Iinclude -shared \
-Wl,-soname,libpthread-setaffinity.so -ldl -o bin/libpthread-setaffinity.so \
src/pthread-setaffinity.c src/cpuset.c

echo /opt/westcloud/libpthread-setaffinity.so > /etc/ld.so.preload

About

A hook to pthread setaffinity to set affinity within cgroup cpu set cpus

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages