jcjohnson / neural-style

Torch implementation of neural style algorithm
MIT License
18.31k stars 2.71k forks source link

mixed-gpu opencl backend #436

Open mkirshner opened 6 years ago

mkirshner commented 6 years ago

Hey, first ever Github post. Thanks for your great code!

I'm running Ubuntu 16.04 with an 8GB AMD Radeon R9 390 and a 6GB NVIDIA GTX 1060. Using the OpenCL backend on distro-cl torch, I can successfully utilize each GPU to independently implement neural-style. Additionally, I can use the CUDNN backend with the NVIDIA card when using the main torch distribution. I'm hoping to use the multiGPU function to use both my AMD and NVIDIA cards on the OpenCL backend togther, to expand my overall available video memory and produce higher res images. However, when I put in the code to do so, I receive an error. as seen below. Is there something in my mixed GPU environment that might be causing it? Any advice? Thanks again!

ubuntu@ubuntu:~/neural-style-master$ th neural_style.lua -gpu 1,0 -multigpu_strategy 20 -backend clnn -style_image calvin2.jpg -content_image adam1.jpg libthclnn_searchpath /home/ubuntu/torch-cl/install/lib/lua/5.1/libTHCLNN.so
Using Advanced Micro Devices, Inc. , OpenCL platform: AMD Accelerated Parallel Processing Using OpenCL device: Hawaii Successfully loaded models/VGG_ILSVRC_19_layers.caffemodel conv1_1: 64 3 3 3 conv1_2: 64 64 3 3 conv2_1: 128 64 3 3 conv2_2: 128 128 3 3 conv3_1: 256 128 3 3 conv3_2: 256 256 3 3 conv3_3: 256 256 3 3 conv3_4: 256 256 3 3 conv4_1: 512 256 3 3 conv4_2: 512 512 3 3 conv4_3: 512 512 3 3 conv4_4: 512 512 3 3 conv5_1: 512 512 3 3 conv5_2: 512 512 3 3 conv5_3: 512 512 3 3 conv5_4: 512 512 3 3 fc6: 1 1 25088 4096 fc7: 1 1 4096 4096 fc8: 1 1 4096 1000 Setting up style layer 2 : relu1_1 Setting up style layer 7 : relu2_1 Setting up style layer 12 : relu3_1 Setting up style layer 21 : relu4_1 Setting up content layer 23 : relu4_2 Setting up style layer 30 : relu5_1 /home/ubuntu/torch-cl/install/bin/luajit: neural_style.lua:401: attempt to call field 'GPU' (a nil value) stack traceback: neural_style.lua:401: in function 'setup_multi_gpu' neural_style.lua:151: in function 'main' neural_style.lua:601: in main chunk [C]: in function 'dofile' ...s/torch-cl/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x00405e90

ProGamerGov commented 6 years ago

Is it an issue with missing or out of date packages?

https://github.com/jcjohnson/neural-style/issues/360

https://github.com/jcjohnson/neural-style/issues/164

If not, then maybe this issue has helpful information?

https://github.com/jcjohnson/neural-style/issues/44