可以用
#include <stdio.h>
OK 囉。
~$ nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2018 NVIDIA Corporation Built on Sat_Aug_25_21:08:01_CDT_2018 Cuda compilation tools, release 10.0, V10.0.130 ~$ python3 --version Python 3.5.2選好,就會出現...Run this command:
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1.post2-cp35-cp35m-linux_x86_64.whl pip3 install torchvision!!不要follow instruction upgrade pip 到 19.0.3.會有 main 錯誤
pip3 install numpy測試..
from __future__ import print_function import torch x = torch.rand(5,3) print(x)會是
tensor([[0.6098, 0.0374, 0.9580],
[0.9531, 0.2159, 0.9694],
[0.5153, 0.7471, 0.1269],
[0.0336, 0.2670, 0.2762],
[0.8283, 0.4620, 0.9425]])
然後
torch.cuda.is_availebl() True
apt install tasksel tasksel install mate-desktop裝完後。選 lightdm 登入
dpkg-reconfigure lightdm選 lightdm 之後重開機就可以。
The following packages have unmet dependencies:
libgl1-nvidia-glx : Depends: nvidia-alternative (= 384.130-1)
Depends: libnvidia-glcore (= 384.130-1) but 390.87-8~bpo9+1 is to be installed
Recommends: nvidia-kernel-dkms (= 384.130-1) or
nvidia-kernel-384.130
E: Unable to correct problems, you have held broken packages.
Xorg.0.log:
The following packages have unmet dependencies:
libgl1-nvidia-glx : Depends: nvidia-alternative (= 384.130-1)
Depends: libnvidia-glcore (= 384.130-1) but 390.87-8~bpo9+1 is to be installed
Recommends: nvidia-kernel-dkms (= 384.130-1) or
nvidia-kernel-384.130
E: Unable to correct problems, you have held broken packages.
...
實際上 remove bumblebee, bumblebee-nvidia, primus 之後,load nvidia_drv.so 就 OK 了。
jessie431:~$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Kensington Kensington Expert Mouse id=10 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=13 [slave pointer (2)]
⎜ ↳ TPPS/2 IBM TrackPoint id=14 [slave pointer (2)]
⎜ ↳ Logitech USB Optical Mouse id=16 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ Power Button id=9 [slave keyboard (3)]
↳ Integrated Camera id=11 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=12 [slave keyboard (3)]
↳ ThinkPad Extra Buttons id=15 [slave keyboard (3)]
jessie431:~$ xinput get-button-map 16 3 2 1 4 5 6 7 8 9 10 11 12設成 right handed:
jessie431:~$ xinput set-button-map 16 1 2 3 4 5 6 7 8 9 10 11 12 jessie431:~$ xinput get-button-map 16 1 2 3 4 5 6 7 8 9 10 11 12這樣 Logitech (id=16) 的 button mapping 就變更了,其他 device 的 mapping 沒變。
cd tools/kconfig-frontends
./configure --disable-shared --enable-static --enable-mconf --disable-nconf --disable-gconf --disable-qconf
--disable-nconf --disable-utils --prefix=/home/charles-chang/nuttx-git/bin/
make
make install
然後看看,kconfig-conf install 在 /home/charles-chang/nuttx-git/bin/bin 下。cd nuttx tools/configure.sh stm32f4discovery/usbnsh make menuconfig修改一下 build-host 平台,是 Linux (default 是 Windows)
st-flash write nuttx.bin 0x8000000這樣就燒完了。